deagon
Posts: 31
|
Posted: 08/20/2008, 9:25 AM |
|
I'm having problems with the Formname.UpdateAllowed function. I'm using
If this function is true then make FormName.updateallowed = False else
FormName.UpdateAllowed = True. Used in the Before show. Not working very well
very unstable or not working at all. I seem to be missing how this function works.
My Form code looks like this
If RmaStorage1.RMAJobType.Value = "3Warranty" and RmaStorage1.WarrantyAuth.Value <> "" Then
RmaStorage1.updateAllowed = True
ElseIf Rmastorage1.RMAJobType.Value = "3Warranty" and RmaStorage1.WarrantyAuth.Value = "" Then
RMAStorage1.updateAllowed = False
End If
Is there a clear way to make this work. We don't want some one to update the form if specific data is missing.
Thanks
|
|
|
wkempees
Posts: 1679
|
Posted: 08/20/2008, 9:30 AM |
|
Although I am not an ASP guy, on a general note:
In BeforeShow set RMAStorage1.updateAllowed = False
On Validate of the Form do your test and set UpdateAllowed accordingly.
OR
The Button Submit (Update) event OnClock (Server)
could have the coding you originally used.
Walter, HTH
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
|
|
deagon
Posts: 31
|
Posted: 08/20/2008, 9:32 AM |
|
Thanks Walter for the quick response, I'll check it out.
|
|
|
deagon
Posts: 31
|
Posted: 08/20/2008, 11:47 AM |
|
Still not working correctly. I can make the update submit button not displayed by inserting
BeforeSelect(Sender) page RmaStorage1.UpdateAllowed = False. Now the problem is getting the page Update button to appear under conditions being met. If authorization number is <> "" then the button should be seen. I'm missing something here. It doesn't matter where the code is inserted the Update button is never visible.
|
|
|
wkempees
Posts: 1679
|
Posted: 08/21/2008, 6:03 AM |
|
deagon,
you should post here the exact code and the exact description of the events in which you are you are using the code.
As you are moving things around it could get confusing fast four you for me and for CCS as well.
Post here something like :
TheEventName
[ code ] (lose the spaces)
The code
[ /code ]
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
|
|
deagon
Posts: 31
|
Posted: 08/21/2008, 7:56 AM |
|
Good Morning Walter,
Thanks again for your response.
I've been trying different code form and my last try still is not working, here is the code.
Function RmaStorage1_BeforeShow(Sender) 'RmaStorage1_BeforeShow @75-1A65EEF2
'Custom Code @123-73254650
' -------------------------
RmaStorage1.UpdateAllowed = False
Dim Hidden
Hidden = RmaStorage1.WarrantyAuth.Value
RmaStorage1.WarrantAuthHD.Value = Hidden
If CCGetParam("WarrantyAuth",Empty) = CCGetParam("WarrantyAuthHD",Empty) Then
RmaStorage1.UpdateAllowed = True
End If
' Write your own code here.
' -------------------------
'End Custom Code
End Function 'Close RmaStorage1_BeforeShow @75-54C34B28
|
|
|
deagon
Posts: 31
|
Posted: 08/21/2008, 8:35 AM |
|
I've been able to make this work to some degree, but it doesn't update if the data field is blank or not. It only works the first time you go into the RmaStorage1 page. Here is the code.
Function RmaStorage1_BeforeUpdate(Sender) 'RmaStorage1_BeforeUpdate @75-6B1C0126
'Custom Code @125-73254650
' -------------------------
RmaStorage1.UpdateAllowed = False
' Write your own code here.
' -------------------------
'End Custom Code
End Function 'Close RmaStorage1_BeforeUpdate @75-54C34B28
and Then added this code to look for no data.
Function RmaStorage1_BeforeShow(Sender) 'RmaStorage1_BeforeShow @75-1A65EEF2
'Custom Code @123-73254650
' -------------------------
If RmaStorage1.WarrantyAuth.Value <> "" Then
RmaStorage1.UpdateAllowed = True
End If
I've moved the code around in differnet locations but this is the best so far.
|
|
|
Oper
Posts: 1195
|
Posted: 08/21/2008, 11:06 AM |
|
if (your checkc)
' Auth Passed
objform.updateallowed=true
else
' Auth Not Passed
objform.updateallowed=false
End if
also to do a good test
if (your checkc)
' Auth Passed
objform.updateallowed=true
Response.write "-----------------------PASSED"
else
' Auth Not Passed
objform.updateallowed=false
Response.write "--------------------- NOT PASSED"
End if
you could take off the response.write later
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|