1

Good evening to all!

I'm trying to figure out why a syntax-correct Checkbox formula is returning an #Error when it encounters a True result, but a correct empty checkbox when encountering a False result.

The formula's purpose being to ensure that only Meeting records created by certain Roles, assigned to certain Role holders, bearing specific criteria and being of a certain Record Type will be counted as True.

The formula is as follows:

IF(    OR( Owner:User.UserRoleId = '00E70000001EIHY', 
           Owner:User.UserRoleId = '00E70000001BIgq') 
    && OR( CreatedBy.UserRoleId  = '00E70000001EIHT', 
           CreatedBy.UserRoleId  = '00E70000001EIHS') 
    && ISPICKVAL(CallType,"Meeting") = True 
    && OR( ISBLANK(TEXT(Call_Result__c)) = True, 
           AND( ISBLANK(TEXT(Call_Result__c)) = False, 
                TEXT(Call_Result__c) <> "Cancelled per client" ) ) 
    && OR( RecordType.Id = '012700000001kKq', 
           RecordType.Id = '012700000001kKr', 
           RecordType.Id = '012700000001kKs') 
  ,TRUE
  ,FALSE )

The code is syntax correct and is displaying results, just not valid results.

What am I missing? Is there an open-ended line that is causing some sort of invalidation in the True?

Thank you and all the best.

  • I'm fairly sure that you can remove the =True conditions in most cases. Also, you could wrap the whole thing in a big AND() and remove the &&'s perhaps they are causing the problem. – Caspar Harmer Aug 9 '17 at 4:10
  • Also, as I'm pretty sure the statement is evaluated in order until it gets a false, the reason why the false works is that it exits the expression before it encounters the error. Hence, if you remove all but one condition and successively add them back, you'll be able to determine which OR() statement is responsible for the error. – Caspar Harmer Aug 9 '17 at 4:14
  • Good morning and thank you for the insight Caspar! I'll be sure to try your suggestions now and in future as I'm aware my syntax isn't the most efficient it could be; especially when lacking an ELSE condition that I anticipate receiving later. Will report back! – Sovereignty Aug 9 '17 at 12:09
0

I think for ISPICKVAL, ISBLANK functions true and false comparison not needed

Can you check if this works for you

IF( (Owner:User.UserRoleId = '00E70000001EIHY' || Owner:User.UserRoleId = '00E70000001BIgq') 
    && (CreatedBy.UserRoleId  = '00E70000001EIHT' || CreatedBy.UserRoleId  = '00E70000001EIHS') 
    && ISPICKVAL(CallType,"Meeting") 
    && (ISBLANK(TEXT(Call_Result__c)) ||
           (NOT(ISBLANK(TEXT(Call_Result__c))) && 
                TEXT(Call_Result__c) <> "Cancelled per client" )) 
    && ( RecordType.Id = '012700000001kKq' || 
           RecordType.Id = '012700000001kKr' ||
           RecordType.Id = '012700000001kKs') 
  ,TRUE
  ,FALSE )
|improve this answer|||||
  • Good morning and thank you Santanu Boral! I'll try this as soon as I can! – Sovereignty Aug 9 '17 at 12:10
0

I think this should work fine what i did is group all or and by || and using , for AND , replace or with || with brackets.

  IF(AND((Owner:User.UserRoleId = '00E70000001EIHY'||Owner:User.UserRoleId = '00E70000001BIgq'),( CreatedBy.UserRoleId  = '00E70000001EIHT' || CreatedBy.UserRoleId  = '00E70000001EIHS'),ISPICKVAL(CallType,"Meeting"),(ISBLANK(TEXT(Call_Result__c)) = True 
|| (AND( ISBLANK(TEXT(Call_Result__c)) = False, 
                TEXT(Call_Result__c) <> "Cancelled per client" )), ( RecordType.Id = '012700000001kKq' ||
           RecordType.Id = '012700000001kKr' ||
           RecordType.Id = '012700000001kKs')) ,TRUE ,FALSE )
|improve this answer|||||
  • Good morning and thank you hasectic saif! I'll try this as soon as I can! – Sovereignty Aug 9 '17 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.