Hello Community!
Is posible add a filter for a lookup field in a edit list grid? I need filter the lookup base a condition for each row.
Also, is work the dependencies attribute, to execute a function on the field change?
Regards,
https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-detail-editable-list
Like
Dear Federico,
There was a similar question here about detail filter.
As to your second question, could you explain what do you mean?
Peter Vdovukhin,
Is not the same question a need filter the items inside of lookup based on the primary id of the row.
Is like add the confg on the attributes to the field in the page edit but in the detail.
And the second question is like add a OnChage on the field of the grid.
If speak about the detail filter I still don't see the difference. Could you add more information?
Answering your second question. There is no anything special between changing something in a detail and edit page. So you will need to create an attribute with dependencies and to set what method will fire when the attribute is changed. For example here is an example for an edit page
Or you may look at BaseProductDetailPageV2 schema:
attributes: {
...
"TaxAmount": {
name: "TaxAmount",
dataValueType: Terrasoft.DataValueType.FLOAT,
dependencies: [
{
columns: ["Amount", "DiscountTax"],
methodName: "setTaxAmount"
}
]
},
...
}
...
methods: {
...
setTaxAmount: function() {
var taxAmount = this.calcTaxAmount();
if (this.get("TaxAmount") !== taxAmount) {
this.set("TaxAmount", taxAmount);
}
},
...
}
...
diff: {
...
{
"operation": "insert",
"name": "DiscountTax",
"parentName": "AmountBlock",
"propertyName": "items",
"values": {
"bindTo": "DiscountTax",
"enabled": false,
"layout": {
"column": 12,
"row": 3,
"colSpan": 12
}
}
},
...
}
Peter Vdovukhin,
But this is work in a editble list detail? I add the dependencies attribute in a editable list detail and not execute de function.
Yes, It works for me. I tested this yesterday. I told you, check BaseProductDetailPageV2 schema. The setTaxAmount method will be launched when you change some of the dependent columns in an order in a product editable list
Peter Vdovukhin,
In the BaseProductDetailPageV2 the attributes is work on the edit page. I don't have a edit page. I need put the filter in the lookup listed in the editable list detail to filter the field in the image, the equivalent of ProductDetailV2. Exist a example of that?
Dear Federico,
Just try it and you will see it works. You may also use Detail wizard from the parent page to add some business rules such filters and making fields editalble and you will see that these rules work in an editable list and stored in a DetailPageV2.