Fetch the entire address text on a custom field
This article will help you to add a custom field for fetching full addresses on any DocType, using a 3 step approach.
Step 1. Cosmetic customisations on the required DocType
We would first need to add two new fields on the DocType for fetching addresses:-
a) A field of type 'Link' which points to our Address master
b) A field of type 'Read Only' which would display the full address
Tell the developer the names of the two new fields.
For information on creating custom fields on a DocType you can refer to the following link - Custom Fields in iVendNext
Once this step is done you should have two new fields on the selected DocType.
Step 2. Adding a Client Script for fetching the full address from our Address master
Search for 'Client Script' on the search bar, and create a new Client Script. Select the required DocType on which we need to fetch the address on.
A developer adds the script in the Client Script. It reads the address you pick in the link field and puts the full address text in the read only field. When you clear the link field, the script clears the read only field too.
The developer needs the DocType that gets the address, for example Sales Invoice or Purchase Order, and the names of the two fields from Step 1.
Step 3. Save, enable and test the Client Script
When the developer has added the script, save the Client Script and tick the 'Enabled' checkbox.
Go to the required DocType and refresh the page for the changes to take effect.
Now when an address is selected on our custom link field, the entire address will be fetched on our custom read only field.