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
pavan kumar 1864pavan kumar 1864 

formula firld error in report

HI,I HAVE A REQUIREMENT WHICH STATES THAT IF Account.Agreement_type__c AND Opportunity.Agreement_type__c IS NOT BLANK AND IF BOTH THE VALUES ARE THE SAME THEN RETURN 1 OR ELSE 0.

IF(NOT(ISBLANK(Account.Agreement_type__c)) AND NOT(ISBLANK(Opportunity.Agreement_type__c)) 
AND (TEXT(Account.Agreement_type__c) == TEXT(Opportunity.Agreement_type__c)),1,0)


I'M GETTING A ERROR AS MISSING ) AND DON'T KNOW WHETHER THIS CODES WORKS AS PER MY REQUIREMENT OR NOT.
CAN ANYONE GUIDE ME
Best Answer chosen by pavan kumar 1864
OFröhlichOFröhlich
Hi,
the idea is right.

Use && instead of AND 
or
IF (
AND(
NOT(ISBLANK(Account.Agreement_type__c)),
NOT(ISBLANK(Opportunity.Agreement_type__c)),
TEXT(Account.Agreement_type__c)==TEXT(Opportunity.Agreement_type__c)
)
,1,0)

If this helps, please mark as Best Answer to help others too.

All Answers

OFröhlichOFröhlich
Hi,
the idea is right.

Use && instead of AND 
or
IF (
AND(
NOT(ISBLANK(Account.Agreement_type__c)),
NOT(ISBLANK(Opportunity.Agreement_type__c)),
TEXT(Account.Agreement_type__c)==TEXT(Opportunity.Agreement_type__c)
)
,1,0)

If this helps, please mark as Best Answer to help others too.
This was selected as the best answer
AbhinavAbhinav (Salesforce Developers) 
Hi Pavan,

Try this:

IF( AND( NOT(ISBLANK(Field1__c)), NOT(ISBLANK(Field2__c)), TEXT(Field1__c) == TEXT(Field2__c) ),1,0)

Thanks!