This topic is locked
[SOLVED]

 is ASPrunner has this kind of power ?

7/6/2010 4:46:09 AM
ASPRunnerPro General questions
M
magma7247 author

I have form with many fields in one table called database , and the form has like ( TEL number , name, Invoice# ..... ) and all users have edit permission on that form, I want to prevent users from editing invoice filed only and can edit the rest of the fileds, and I want to make the admin edit permission on all including invoice filed.
so, the admin has edit on everything and users the have the same except the invoice # , read only.
how to do this ?

A
ann 7/6/2010

Hi,
create an alias of the field on the Edit SQL Query tab:

select

FieldName as Alias,

...

from TableName



Then set up Alias as readonly in the Edit as settings dialog.

Add to the Before display event the following code:

if Session("UserID")="admin" then

xt.assign "FieldName_fieldblock",true

xt.assign "Alias_fieldblock",false

else

xt.assign "FieldName_fieldblock",false

xt.assign "Alias_fieldblock",true

end if



where FieldName is your actual field name, TableName is actual table name

M
magma7247 author 7/6/2010

Dear Ann,
I add the alias as for invoice# as invoice#, and I added the code in the events tab/edit page/ edit page before display ,and also I did make invoice# filed as read only in the visual editor.
what happen is, when I login as admin and I try to edit record, I keep seeing invoice number read only.
one more thing, I make the employee filed as session("UserID") and I make the "apply on the edit page as well" OFF__,
so once I try edit any record I'll keep seeing the owner name not the admin while I logged in as admin.
I want to keep the owner name in the record even if I edit his record, so even if this code works it will not accomplish the job.

  • admin can edit all fields
  • user can edit all his fields, except invoice# filed read only.
  • I want to keep the owner username in the record and not replace with the editor.( admin )
    Regards.
    regards.

A
ann 7/7/2010

Hi,
you can't create an alias with the same name.

If you check off Apply on the edit page as well option (Edit as settings dialog on the Visual Editor tab) then the old value will be saved.
If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

M
magma7247 author 7/9/2010

Hi,
I tried all the possibilities, nothing work,

I tried also both access both below codes also nothing happen

is there a way to block field only unblock it to admin ?
please tell me.
=======================================

if Session("UserID")="admin" then
xt.assign "fieldname_fieldblock",True
else
xt.assign "fieldname_fieldblock",False
end if
=============================================

2. the admin group.

=============================================

if Session("AccessLevel")=ACCESS_LEVEL_ADMINGROUP then
xt.assign "fieldname_fieldblock",True
else
xt.assign "fieldname_fieldblock",False
end if

A
ann 7/9/2010

Hi,
make sure you use correct field name.

If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

M
magma7247 author 7/9/2010

Hi Ann,
I did upload the project and you'll see that I added alias to invoice# filed as invoice
I will PM your the username and the password
regards.

A
ann 7/12/2010

Hi,
please open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

M
magma7247 author 7/12/2010

Hi Ann,
I just did.
regards.

M
magma7247 author 7/13/2010

[size="4"]YES[/size], it has this kind of power, and Jane prove it <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51128&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />, Thanks Jane, and Thanks for brilliant Ann.