Question
We have a task to lock editing of a Supplier field on the contract edit page (ContractPage) under certain conditions. We have tried "this.get" and "find('Supplier')" and set an "enabled" and "IsEnabled" options, it didn't help. We have also consulted Google - but it didn't work.
If the supplier field is cleared, the payment details are blocked, that is such functionality is available in bpm'online. How can we use it? I mean, we need to have it on the program level, not through connecting, etc., since the locking conditions are quite complicated and can be changed with time or require database queries, etc.
Answer
This function can be implemented as follows:
var supp = this.find('Supplier'); supp.customConfig = { enabled: { bindTo: 'methodName''} }
or
var supp = this.find('Supplier'); supp.customConfig = { enabled: false }
The below example of a code demonstrates locking of the "Supplier" field if the "Number" field value is not equal to "2":
var supp = this.find('Supplier'); supp.customConfig = { enabled: { bindTo: 'test'} } this.methods.test = function(){ return this.get('Number') == '2' };