07-11-2019, 03:30 PM
(This post was last modified: 07-12-2019, 03:04 PM by elisa.deko.)
Hello Omar,
I think that what you are asking for, can be done using a Validations Map. You can use an Expression for making the field mandatory or if you need to do more complicated validations go on creating a custom function.
I'm writing you here a simple example where an expression is used to make mandatory the field Codice Fiscale when the picklist field Natura Fiscale contains the value "Ditta Individuale"
Validation Map
<map>
<originmodule>
<originname>Accounts</originname>
</originmodule>
<fields>
<field>
<fieldname>naturafisc_account</fieldname>
<validations>
<validation>
<rule>expression</rule>
<restrictions>
<restriction>Make_CF_Mandatory</restriction>
</restrictions>
</validation>
</validations>
</field>
</fields>
</map>
Expression Map (Make_CF_Mandatory)
<map>
<expression>if ($(account_id : (Accounts) naturafisc_account) == 'Ditta Individuale') then (if ($(account_id : (Accounts) codice_fiscale) != '' or account_id : (Accounts) codice_fiscale) != 0) then 1 else 0 end) else 0 end</expression>
</map>
Let me know if this helps
Elisa
I think that what you are asking for, can be done using a Validations Map. You can use an Expression for making the field mandatory or if you need to do more complicated validations go on creating a custom function.
I'm writing you here a simple example where an expression is used to make mandatory the field Codice Fiscale when the picklist field Natura Fiscale contains the value "Ditta Individuale"
Validation Map
<map>
<originmodule>
<originname>Accounts</originname>
</originmodule>
<fields>
<field>
<fieldname>naturafisc_account</fieldname>
<validations>
<validation>
<rule>expression</rule>
<restrictions>
<restriction>Make_CF_Mandatory</restriction>
</restrictions>
</validation>
</validations>
</field>
</fields>
</map>
Expression Map (Make_CF_Mandatory)
<map>
<expression>if ($(account_id : (Accounts) naturafisc_account) == 'Ditta Individuale') then (if ($(account_id : (Accounts) codice_fiscale) != '' or account_id : (Accounts) codice_fiscale) != 0) then 1 else 0 end) else 0 end</expression>
</map>
Let me know if this helps
Elisa