Hi All,
We would like to filter a detail from a value of a previous detail.
For example:
In opportunities we have a detail witch we have to select the car model. in the same opportunities we have to filter another detail named Accessory car from the car model to list the accessories related to the car model.
Is there anyone who can help ?
Thanks
Like
Dear Aymen,
You can use code from the following article: https://community.bpmonline.com/articles/filtering-detail-records-based…
Thanks for the response Angela,
I try it, but it's not exactly what we want.
We have to get the field variable (Car Name for example) of first detail and display it in the field variable of second detail .
-Note : We are entitled only to insert a single line in the first detail. (example : Car Name)
Dear Aymen,
If I understood you correctly, you would like to have records added to the first detail and based on values in field "Car" you would like to display only those accessories, which are related to those cars.
In this case please use the example provided by Angela, however, make modifications to the code in first detail. Particularly, you can do one of the following:
1. Override the save method on the detail, so when saving new record, you retrieve the value from the car field and pass it through the sandbox (masterDetailRecordId variable in the example).
After you receive sandbox, filter records on the second detail as in the example.
2. Trigger sandbox publish message on change of car field value. To do so, add the attribute to the detail page schema, which would read the value from car field and send it to second detail as in the example.
"OnCarChange":{ "dependencies":[ { "columns":["Car"], "methodName":"sendCarValue" }] }
Hope you will find it helpful.
Regards,
Anastasia
Thanks Anastasia Botezat,
that's exactly what I need,
I will try it, However, in the example of Angela, I get error related to this line :
var masterDetailRecordId = typeof activeRow === "object" ? activeRow && activeRow.value : activeRow;