Add data links to the form
After you have added the new page and questions to capture visa information, next we must add the data links that will write this information to the Visas object when the form is submitted.
Add data link rules
-
On the Form Definition page, select the Data Links tab.
-
Select New Rule.
- Begin configuring the rule as follows:
- Form Field: VisaCountry1
Direction: In
-
Select Advanced rule.
The Form Field and Data Field picklists become the editable fields Form Data Name and Object Field Name.
-
In the Object Field Name field, enter the API name of the record we need to update. Because we will be updating 3 sets of records, we will use the [0], [1], [2] numbering convention to identify each record. Enter:
fHCM2__Team_Member__r.Visas__r[0].fHCM2__Country__c
For information on how to create an object field name/API name for a linked record, and how to create multiple records, see Advanced data link rules.
Note In this case you must enter the Object Field Name manually. -
Enter a condition to ensure that the rule does not create a record if the field is not entered by the user:
NOT (VisaCountry1 = "-Please Select-")
- Select Save.
-
Complete the rest of the rules as follows. Mark all rules as Advanced rule, with the direction: In.
Form Data Name Object Field Name Condition VisaCountry1 fHCM2__Team_Member__r.Visas__r[0].fHCM2__Country__c NOT (VisaCountry1 = "-Please Select-") VisaNumber1 fHCM2__Team_Member__r.Visas__r[0].fHCM2__Visa_Number__c NOT (ISBLANK(VisaNumber1)) VisaExpiry1 fHCM2__Team_Member__r.Visas__r[0].fHCM2__Expiry_Date__c NOT (ISBLANK(VisaExpiry1)) VisaCountry2 fHCM2__Team_Member__r.Visas__r[1].fHCM2__Country__c NOT (VisaCountry2 = "-Please Select-") VisaNumber2 fHCM2__Team_Member__r.Visas__r[1].fHCM2__Visa_Number__c NOT (ISBLANK(VisaNumber2)) VisaExpiry2 fHCM2__Team_Member__r.Visas__r[1].fHCM2__Expiry_Date__c NOT (ISBLANK(VisaExpiry2)) VisaCountry3 fHCM2__Team_Member__r.Visas__r[2].fHCM2__Country__c NOT (VisaCountry3 = "-Please Select-") VisaNumber3 fHCM2__Team_Member__r.Visas__r[2].fHCM2__Visa_Number__c NOT (ISBLANK(VisaNumber3)) VisaExpiry3 fHCM2__Team_Member__r.Visas__r[2].fHCM2__Expiry_Date__c NOT (ISBLANK(VisaExpiry3))
Test the form
Make sure you test the form to ensure the pages and questions are behaving as expected, and the data links are writing information correctly. You can test the form using a sandbox environment, or publish the form to WX using a policy and users reserved for testing.