You need to sign in to do that
Don't have an account?

Simple Trigger to Calculate Math.ABS
Hi Team,
We are trying to implement a validation on Quote Page by using the below formula.
IF (Service_Total_Net_Price_c _< 0 and ABSOLUTEVALUE Service_Total_Net_Pricec _ > ABSOLUTEVALUE _Total_Service_Margin_c )
Here is the Trigger which I have created but I'm getting an error while trying to save the trigger, Can anyone please take a look and let me know what is the issue.
trigger CustomQuoteValidation on SBQQ__Quote__c (before insert) {
for (SBQQ__Quote__c a : Trigger.new) {
if (a.Service_Total_Net_Price__c < 0 && (MATH.ABS(a.Service_Total_Net_Price__c > a.Total_Service_Margin__c ) )) {
a.addError('Your custom error message');
}
}
}
Thanks,
Zeeshan.
We are trying to implement a validation on Quote Page by using the below formula.
IF (Service_Total_Net_Price_c _< 0 and ABSOLUTEVALUE Service_Total_Net_Pricec _ > ABSOLUTEVALUE _Total_Service_Margin_c )
Here is the Trigger which I have created but I'm getting an error while trying to save the trigger, Can anyone please take a look and let me know what is the issue.
trigger CustomQuoteValidation on SBQQ__Quote__c (before insert) {
for (SBQQ__Quote__c a : Trigger.new) {
if (a.Service_Total_Net_Price__c < 0 && (MATH.ABS(a.Service_Total_Net_Price__c > a.Total_Service_Margin__c ) )) {
a.addError('Your custom error message');
}
}
}
Thanks,
Zeeshan.
Please check once below code :
Hope this helps you!
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
Thanks for quick response. Is it possible have the absolute value for (a.Service_Total_Net_Price__c > a.Total_Service_Margin__c) as we have a negative sign in one of the value?
Thanks,
Zeeshan.