function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anvesh PaidakulaAnvesh Paidakula 

Need Suggetion for this calculation ?

I have 2 objects fields are there. For Transfer object i have Expected Premium field and For Transaction object i have Amount field.

The calculation was Transfer 'Expected Premium' should be 10% of Transaction Amount.then a field is updated on Transfer Record. The problem it need to calculte below 10% and also above 10% Range. I have given below formulae but it wasnt work.

If(exchange.Expected_Premium__c <= 0.1*trans.Amount__c || exchange.Expected_Premium__c >= 0.1*trans.Amount__c ){
exchange.Transfer_Rec_d__c = true; (CheckBox field)
}

But for this , If i give out of boundaries also , it enables the check box. This ll fires while creating Transaction Record. (we ll enter the Amount while creating Transaction Record. So Trigger ll fire and  check with the condition )
Phillip SouthernPhillip Southern
Hi Anvesh, the issue is for the comparisons...that is saying basically everything....for anything below 10% of trans.amount__c OR anything above 10% of trans.amount__c.  That would be everything.  You need to break it out and then perform assignments as need like this:

if(exchange.expected_premium__c <= (0.1 * trans.amount__c))
{
  //premium is below or at 10%, do something here.

}else
{
  //if not below 10% then its above..do something here.

}

Based on your post I'm not sure what you are wanting to do in each scenario so just insert your assignments as needed.