Assignment with Custom JS Code
General
Changing the value of one field assigns a value to another field.
Status
Release Available | Status | Framework Name |
---|---|---|
3.2 | Current | MUI and Mint |
Code JSON
"generalHandlers": { "fieldChange": { "genesis__Residual_Amount__c, genesis__Payment_Frequency__c": { "assignments": [{ "field": "$this.attr(genesis__Interest_Rate__c);", "value": "$ext.calculateInterestRate", "arguments": [ "$this.attr(genesis__Residual_Amount__c);", "$this.attr(genesis__Payment_Frequency__c);" ] }, { "field": "$this.attr(genesis__Payment_Amount_Per_Period__c);", "value": "$ext.calculateMonthlyPayment", "arguments": [ "$this.attr(genesis__Residual_Amount__c);", "$this.attr(genesis__Payment_Frequency__c);" ] }] }}}
Code JSON
<script type="text/javascript"> const portalext = {}; portalext.calculateInterestRate = (amount, term) => { ... }; portalext.calculateMonthlyPayment = (amount, term) => { ... }; </script>