I would like to update other fields on a form based on a value entered in a field.
I have a field WEBPOL:InsuredValue in which I enter a value. [Image1.png]
On the Client Side Tab I tick the Send New value to server
In the server Code Button
I embed DO CalculatePremium !server side code
In ProcedureRoutines I have this code
CalculatePremium ROUTINE
IF WEBPOL:InsuredValue
WEBOPT:InsuredTo = WEBPOL:InsuredValue
ACCESS:WebOption.Open()
ACCESS:WebOption.Usefile()
SET(WEBOPT:SK_ToValue,WEBOPT:SK_ToValue)
NEXT(WebOption)
IF ERRORCODE()
p_web.SetSessionValue('WEBPOL:GrossPremium',0)
ELSE !Found record
WEBPOL:GrossPremium = WEBOPT:BasePremium
p_web.setSessionValue('WEBPOL:GrossPremium',WEBPOL:GrossPremium)
END
MESSAGE('WEBPOL:GrossPremium ' & WEBPOL:GrossPremium & ' WEBOPT:BasePremium ' & WEBOPT:BasePremium)
ACCESS:WebOption.Close()
END
Exit
The value of WEBPOL:GrossPremium is the same as the value of WEBOPT:BasePremium [Image2.png]
The field WEBPOL:GrossPremium is set as display on the tab but no value is displayed.
I have other fields which will also update in this procedure but I am sure the same principle will apply to them
P.S. The message command will be replaced by CapeSoftMessageBox before production.
Any help appreciated.
[attachment deleted by admin]