Here I will go into detail on how you can retrieve data from other entities without the need for code!
Load Reference
Load Reference can only be used if there are Lookup’s on the form you wish to retrieve data from. In my example I want to retrieve the Telephone number from the Service Account and put it on the Work Order form.
First thing, I will add a new variable which will retrieve the Entity of msdyn_serviceaccount. This will give the user access to the Account that’s attached to the Work Order. If you wish for this functionality to work offline. Then you will need to make sure that the data is available locally on the tablet.
Then in the Form Rules I added a new condition which checks if there is a Service Account on the form. Then it assigns the Service Account’s telephone number to my custom field I created – new_telephone.
Then below I added the new_telephone field onto the Work Order Form.
When I run the Work Order, it will now retrieve the telephone number from the Service Account – Litware Facilities.
Load Fetch
Load Fetch can be used if you want to retrieve data from Entities which are not directly related to the Work Order. In my example I want to retrieve the top Contact in the list which is connected to the Service Account and put it on the Work Order form as a Lookup.
First thing, I will add a new variable which will load a fetch for the Entity of contact. This will give the user the ability to return data from Contacts entity. You cant do this with a normal ‘Load Reference’ as the Contact entity is not directly related to the Work Order. If you wish for this functionality to work offline. Then you will need to make sure that the data is available locally on the tablet.
Then if you hit the ‘…’ you can go in and construct an advanced find. In this case I am trying to retrieve the Contact entity where the Service Account equals the current Service Account on the Work Order Form. To do this you will need to click on ‘Set Variable’ and make it point at the entity you want.
Then in the Form Rules I added a new condition which checks if there is a Service Account on the form. Then it assigns the 1st Contact in the list that is connected to related Service Account to my custom lookup field I created – new_contact. ‘@this’ means the primaryid of the contact.
Then below I added the new_contact lookup field onto the Work Order Form.
When I run the Work Order, it will now retrieve the contactid from the 1st contact which is connected to the account – Litware Facilities.
There you have it! Hopefully this article has been useful! 🙂