Fetching Full Address on a Custom Field: Enhancing Efficiency

Introduction

Welcome to this guide on how to fetch the entire address text on a custom field in Empress! This feature is crucial for businesses that need to quickly obtain and display full addresses from their Address master on any DocType. You may find this useful for operations such as invoicing, shipping, and more.

Feature Name: Fetching Full Address on a Custom Field

This feature enables you to add a custom field to any DocType that fetches and displays a full address from the Address master. This is done in three easy steps:

Step 1: Add New Fields to the Desired DocType

First, we need to add two new fields to the target DocType.

  1. A Link type field that connects to your Address master.
  2. A Read-Only type field that will display the full address.

Remember: Write down the names of these new fields. We’ll use them later in the process.

At the end of this step, your selected DocType should have two new fields.

Step 2: Create a Client Script to Fetch the Full Address

Next, we’ll create a new Client Script.

  1. Search for ‘Client Script’ in the search bar.
  2. Select the DocType where you want to fetch the address.
  3. In the script section, paste the provided Client Script.

Here, you’ll need to make a few changes to suit your needs:

  • Replace ‘DocType Name’ with the name of your selected DocType.
  • Replace ‘address_link_field’ with the name of the Link field you created in Step 1.
  • Replace ‘full_address_field’ with the name of the Read-Only field you created in Step 1.

After making these changes, your Client Script should be ready to go!

Step 3: Activate and Test the Client Script

Once you’ve customized your Client Script, save it and enable it by checking the ‘Enabled’ box.

Refresh the page on your chosen DocType to activate the changes.

Now, whenever you select an address in your custom Link field, the full address will be fetched and displayed in your custom Read-Only field.

Conclusion

By following these steps, you can quickly and easily add a custom field to any DocType in Empress that fetches and displays a full address. This feature enhances your business processes by providing a simple and efficient way to access and display address information.

For additional resources or support, please visit the Empress support page or contact our support team.