Hi everybody,
I'm having some problems with a formula. I've been using the formula builder in Object Manager and checking the syntax. I've also tried to go about what I'm trying to do in other ways but I'm not sure how best to go about this.
Here's my formula:
IF(
SBQQ__NetAmount__c >= SBQQ__Opportunity2__r.Previous_Opportunity__r.Amount * 1.07 &&
NOT(ISPICKVAL(SBQQ__Account__r.Type, 'Direct'))
||
SBQQ__NetAmount__c >= SBQQ__Opportunity2__r.Previous_Opportunity__r.Amount * 1.06 && ISPICKVAL(SBQQ__Account__r.Type, 'Direct')), true, false)
Here's what I'm trying to do:
If the amount of a quote on a renewal opp has a price increase of 7% or more compared with the previous opp amount and the account type is not Direct (we have other acc types so it can be any one of those) - be true.
If the amount of a quote on a renewal opp has a price increase of 6% or more compared with the previous opp amount and the account type is Direct - be true.
Otherwise be false.
Why I'm doing this:
I'm adding this as an approval condition to an already convoluted approval rule with lots of other conditions. I'm sure I can just have this as a formula that will evaluate the conditions I described above and deal with this in one formula but I keep hitting syntax errors.
Can anyone see what I'm doing wrong? Any advice greatfully received.
Thanks a lot :)
Matt
Hi Eric,
Thanks so much. I can see that that would work too.
I've actually fixed this by going through the formula builder adding the different functions. Where I went wrong was copying and pasting across and editing a comma here and a bracket there and ended up messing it up.
My working version:
IF(
SBQQ__NetAmount__c >= SBQQ__Opportunity2__r.Previous_Opportunity__r.Amount * 1.07 &&
NOT( ISPICKVAL( SBQQ__Account__r.Type , 'Direct') )
||
SBQQ__NetAmount__c >= SBQQ__Opportunity2__r.Previous_Opportunity__r.Amount * 1.06 && ISPICKVAL( SBQQ__Account__r.Type , 'Direct')
, true, false)
I think I probably did just mess up the brackets and my construction is probably over-complicated but it's working and it meets the requirements now.
Thanks,
Matt