I need to make these two fields visible or not based on the value of the CostCenter in the financial dimension.
My previous approach to implementing similar functions was to change the “visible” properties of other controls in the “modified” method of form controls.
However, the fields in the financial dimension seem to be dynamically rendered, and I don’t seem to be able to extend the “modified” method of CostCenter directly.
I’m not sure if there are any other methods to meet this requirement.
You can check the value of dimension in active method of the data source & based on that you can make it visible or not. Active method is called when you open the form, change record, refresh the record or page, etc.
@Dalux_Chen, see if the below link helps. CostCenter is not a value stored on the sales order. It is part of the financial dimension. It is converted to specific dimension format & stored in a different table. You need to extract value of specific dimension from that. Below link has sample code for it.
Despite encountering some setbacks, I ultimately fulfilled the requirement. The method you provided is indeed feasible.
However, the “active” method will only be called when I click the “save” button, which means that if I check the value of CostCenter in the “active” method, I need to click save first before I can change the visibility of “Vessel” and “Voyage”.
If there were any means to change the visibility of “Vessel” and “Voyage” immediately after modifying the value of “CostCenter” without clicking the “Save” button, that would be even better.
You can write same code in modified method of the data source fields along with active method. It is required in active method, so that if you open an old record, the fields will remain disabled based on the call center value.
But in this case, I will run into this problem again: I don’t know which field I should write the ‘modified’ method for. The CostCenter field is not in the form.