Fetch data from two forms and update it in an HTML view

Assume you have 2 forms : “Customer” and “Purchase”. In “Purchase” Form, if “CustomerInfo” is a lookup field referring to the “Customer” form, the related fields of the Customer Record (their name, address etc) can be directly accessed from the collection variable.

The sample code given below will fetch data from the Customer form

purchaseInfo = Purchase[ID == input.id];
info purchaseInfo.CustomerInfo.Last_Name;
info purchaseInfo.CustomerInfo.First_Name;
info purchaseInfo.CustomerInfo.BirthDay;

In the above code,

- “purchaseInfo” is the collection variable which holds the records from the "Purchase" form, based on the specified criteria.
- purchaseInfo.CustomerInfo.Last_Name will fetch the value of the Last_Name field from the “Customer” form based on the lookup

Share this post : FacebookTwitter