If you ever need to get a value from a lookup field or from other related entity, one of the ways to go is use calculated field.
In the scenario below, we want to get value from lookup field: Product ID and then display this in another entity: Quote Line.
The first thing to do is to create a custom field in the Quote Line entity.
In this scenario, Productidtest:
-
- In the Quote Line entity fields, click new
- Add a display name
- select calculated as the field type
- In the field type, click on Edit button to open the Field Definition Editor for Productidtest.
- This is aspect, we need to set the condition to check if the Product ID contains data for the existing product.
- Under Condition, click the Add condition
- In the entity field, select Existing Product
- In the field select Product ID
- In the Operator select Contains data
- Select the check button to save your action
- Under Action, click “Add action”
- Here we will set the Productidtest to Product ID. This will get product number value we want to display in the field.
- In the edit control, type and select productid (lookup)
- Type “.”
- Type and select productnumber
- Select the check button to save your action
- Finally it will look like this:
- Click on Save and Close button.
- Finally add the productidtest field to Quote Line entity.
- Save and Publish the entity.
- Refresh your browser.
Product entity
Product ID displayed in the Productidtest field in Quote Line entity
Watch the Video