An HTML5 only solution for now. Let me know if that works for you.
I included a Template Text field called "Pay" with following template in the Statement Object
<a href='{!#LINK.receipt3#98338172}' onclick='localStorage.setItem("statementId", "{!id}");localStorage.setItem("statementName", "{!name#text}");'>Pay Now</a>
{!#LINK.receipt3#98338172} - Template token for New Receipt Page
Along with statement record ID and name in this case, you could set as many other values as you need.
Added following script in the New Receipt Page to set the Statement lookup field. You could add more javscript to set other fields that you would like to have preset.
<script>
rbf_selectObject(localStorage.getItem('statementId'),localStorage.getItem('statementName'),-1, "R98338384",false);
</script>
You can decipher values in the template helper as follows
rbf_selectObject(relatedObjectId, relatedObjectRecordName, viewPageId, relationshipname, ismultiselect)
viewPageId - not required here
relationshipname - Related Statement > Relationship Name. This will give you the string to use
ismultiselect - self explanatory
Regards,
Santosh
An HTML5 only solution for now. Let me know if that works for you.
I included a Template Text field called "Pay" with following template in the Statement Object
<a href='{!#LINK.receipt3#98338172}' onclick='localStorage.setItem("statementId", "{!id}");localStorage.setItem("statementName", "{!name#text}");'>Pay Now</a>
{!#LINK.receipt3#98338172} - Template token for New Receipt Page
Along with statement record ID and name in this case, you could set as many other values as you need.
Added following script in the New Receipt Page to set the Statement lookup field. You could add more javscript to set other fields that you would like to have preset.
<script>
rbf_selectObject(localStorage.getItem('statementId'),localStorage.getItem('statementName'),-1, "R98338384",false);
</script>
You can decipher values in the template helper as follows
rbf_selectObject(relatedObjectId, relatedObjectRecordName, viewPageId, relationshipname, ismultiselect)
viewPageId - not required here
relationshipname - Related Statement > Relationship Name. This will give you the string to use
ismultiselect - self explanatory
Regards,
Santosh
It worked. Thank you very much!
In my example setup, the lookup field seems to be saving fine. If you are developing on the public cloud I could take a look at your setup and check for any errors.
Please share your userID if that is the case.
Hi Santosh,
I got it working already. The problem was on the statement ID while setting the link
localStorage.setItem("statementId", "{!statement_id}")
It is because that we have another id (statement_id) in our table. Thank you very much for all the help!
I got it working already. The problem was on the statement ID while setting the link
localStorage.setItem("statementId", "{!statement_id}")
It is because that we have another id (statement_id) in our table. Thank you very much for all the help!