NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: astahl on August 26, 2015, 09:21:18 AM
-
Hi All,
I have a file form that has a variable named loc:returnaddress and is populated as a text field on the form. On an update I want to display the data files separate address fields as a block of text. So I tried the PreUpdate routine to fill the local variable with the text from the separate fields from the database but nothing is displayed. So where would one call this routine to load the loc:returnaddress field
Routine looks like this;
LoadAddress ROUTINE
Access:production.Open()
Access:production.UseFile()
CLEAR(pro:Record)
pro:job_id = CLIP(p_web.GSV('pro:job_id'))
IF NOT Access:production.Fetch(pro:PRIMARY) THEN
IF LEN(CLIP(pro:name)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_name) &'<13,10>'
END
IF LEN(CLIP(pro:company)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_company) &'<13,10>'
END
IF LEN(CLIP(pro:address2)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_address2) &'<13,10>'
END
IF LEN(CLIP(pro:address1)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_address1) &'<13,10>'
END
IF LEN(CLIP(pro:csz)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_csz) &'<13,10>'
END
END
p_web.SetValue('loc:returnaddress',loc:returnaddress)
p_web.SSV('loc:returnaddress',loc:returnaddress)
Access:production.Close()
EXIT
Regards,
Ashley
-
something like this? Some of you if statements could be failing
LoadAddress ROUTINE
Access:production.Open()
Access:production.UseFile()
CLEAR(pro:Record)
pro:job_id = CLIP(p_web.GSV('pro:job_id'))
IF NOT Access:production.Fetch(pro:PRIMARY) THEN
IF LEN(CLIP(pro:name)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_name) &'<13,10>'
END
IF LEN(CLIP(pro:company)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_company) &'<13,10>'
END
IF LEN(CLIP(pro:address2)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_address2) &'<13,10>'
END
IF LEN(CLIP(pro:address1)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_address1) &'<13,10>'
END
IF LEN(CLIP(pro:csz)) THEN
loc:returnaddress = CLIP(loc:returnaddress) & CLIP(pro:envelope_csz) &'<13,10>'
END
END
If loc:returnaddress = ''
loc:returnaddress = 'No Address pro:job_id = ' & CLIP(p_web.GSV('pro:job_id'))
End
p_web.SSV('loc:returnaddress',loc:returnaddress)
Access:production.Close()
EXIT
-
Hi Kevin,
You absolutely correct!!! I was looking at the wrong fields in my IF statements. Better sometimes to walk away and give the eyes and brain a rest.
Thanks so much
Ashley