NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: asigala on August 11, 2009, 12:14:29 PM
-
Hi everybody.
Mi question is how to detect what was the globalrequest to a form . is there any way to know it ?
What i want to do is condition some fields inside the form, if the form was called to update, i want to set them to read only.
Thanks in advance
-
I think the easiest way is by checking the Change_btn value.
First check:
if ~p_web.IfExistsValue('Change_btn')
If the value doesn't exists then the form follows the default action (if you set it up). This shouldn't happen unless you intend it to.
Then it's just a case statement:
case p_web.getvalue('Change_btn')
of 'Insert'
code
of 'Delete'
code
of 'Copy'
code
of 'Update'
code
end
-
There's an easier way.
the loc:act variable is primed for you in the form. So you can test this to see the current action.
= one of
net:InsertRecord
net:ChangeRecord
net:CopyRecord
net:DeleteRecord
Cheers
Bruce
-
Many Thanks Mattew, and Bruce.
I founded this in a topic......
I think this should work and is a complement to Bruce sugestion.
I put this in the generateform star embed.
if p_web.GetSessionValue('UpdatePedido2_CurrentAction') = ChangeRecord THEN
loc:Truper = 1 ! The variable to set the condition
else
loc:Truper = 0
end
Cheers
Alexis