Hi Bruce,
Thank you, this works well for an unencrypted URL.
But if you wanted to encrypt the URL it does not seem to work. By that I mean the form does not seem to be in Change mode and you cannot open any files. Where ever I put the decrypt code and I can see that the SysID if being decrypted correctly but the record is not fetched.
If I try to fetch the record manually after decrypting I get an error 30 when opening the file:
if p_web.GetValue('ds')
if not p_web.GSV('MRL:SysID')
p_web.SSV('LOC:MRLErr',0)
st2.SetValue(p_web.GetValue('ds'))
if st2.Len()
debug('Before decode: '& st2.GetValue())
st2.Base64Decode()
debug('Opened link from DataServer email - MRL:SysID = '& st2.GetValue()) !<<<< This shows the correct SysID
p_web.SSV('MRL:SysID',st2.GetValue())
p_web.OpenFile(MaintReportLog) !<<<< This shows the error 30
if errorcode()
debug('Error on p_web.OpenFile(MaintReportLog), errorcode('& errorcode() &') error('& error() &')')
end!If
clear(MRL:Record)
MRL:SysID = p_web.GSV('MRL:SysID')
p_web.SetSQLTimeout(MaintReportLog,net:on)
if access:MaintReportLog.tryfetch(MRL:KeySysID)
debug('Error on access:MaintReportLog.tryfetch(MRL:KeySysID), errorcode('& errorcode() &') error('& error() &')')
p_web.SSV('LOC:MRLErr',1)
ELSE
debug('Fetched MRL:SysID successfully')
end!If
p_web.SetSQLTimeout(MaintReportLog,net:off)
p_web.CloseFile(MaintReportLog)
ELSE
p_web.SSV('LOC:MRLErr',1)
end!if
end!If
ELSE
p_web.SSV('LOC:MRLErr',0)
end!if
if p_web.GSV('LOC:MRLErr') = 1
p_web.SSV('LOC:MRLErr',0)
p_web.Script(p_web.WindowOpen('MaintLogFilter?err=1','_self'))
end!If
I've tried putting that in the 'Procedure Setup', 'Pre-Update' and 'Before Heading' embeds.
The 'Pre-Update' routine is not called either.
Regards,
Trent