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
Rahul H 4Rahul H 4 

Syntax error. Need help

AND(
          ISPICKVAL(Warranty__c, "External"),
          OR(
                  ISBLANK(TEXT(Repairer__c)),
                  ISBLANK(NUMBER(Total_Price__c)),
                  ISBLANK(DATE(Invoice_Paid_Date__c)),

OR(
AND 

              ISPICKVAL(Warranty__c, "Internal"),
          OR(
                   ISBLANK(TEXT(Repairer__c)),
                   ISBLANK(NUMBER(Total_Price__c))
            )
))))

I am getting error as 
Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text

Need assistance
Priyananth RPriyananth R
Hi,

Follow this link : https://trailhead.salesforce.com/en/content/learn/modules/advanced_formulas/text_formulas
You must check field datatype, because Text() converts a Percent, Number, Date, Date/Time, picklist, or Currency field into Text
Khan AnasKhan Anas (Salesforce Developers) 
Hi Rahul,

Greetings to you!

Please use ISBLANK(Repairer__c) instead of ISBLANK(TEXT(Repairer__c))
As your field "Repairer__c" is of type text, you need not to wrap it around TEXT() method.

As mentioned by Priyananth, TEXT() converts a Percent, Number, Date, Date/Time, picklist, or Currency field into Text.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Rahul H 4Rahul H 4
Hello,

Thanks 

I have updated the formula :

AND( 
ISPICKVAL(Warranty__c, "External"), 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c), 
ISBLANK(Invoice_Paid_Date__c), 

OR( 
AND 

ISPICKVAL(Warranty__c, "Internal"), 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c) 

))))

Its working only when the Warranty Case is external. When Warranty Case is Internal, its not working. 
Rahul H 4Rahul H 4
Its not working even modifying the formual :


OR( 
AND( 
ISPICKVAL(Warranty__c, "External"), 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c), 
ISBLANK(Invoice_Paid_Date__c), 
AND 

ISPICKVAL(Warranty__c, "Internal"), 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c) 

))))
Priyananth RPriyananth R
Hi,

According to my understanding,
If you want Warranty__c == '"External",then validate Isblank of Repairer__c or Total_Price__c or Invoice_Paid_Date__c.
If you want Warranty__c == '"Internal",then validate isblank of Repairer__c or Total_Price__c.
I hope below validation is work, just try,
IF( ISPICKVAL(Warranty__c, "External") , 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c), 
ISBLANK(Invoice_Paid_Date__c)) 
, IF(ISPICKVAL(Warranty__c, "Internal"), 
OR( 
ISBLANK(Repairer__c), 
ISBLANK(Total_Price__c)) , 
false) )