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
gyip31gyip31 

New to Formulas . Why does this not work?

Tyring to create a Time-Dependent Workflow Formula but what i created does not work. 

 

(Organization_Type__c  = business/company || photography/art) AND (OwnerId  = 00530000007jMIb) AND (Lead: Lead StatusEQUALSWorking - Contacted) AND (Lead: Last Modified ByEQUALSToday()+14)

 

 

Anyone know how to get this to work? when i check Syntax is says extra AND and when i remove the AND its says extea "(" To be honest im not sure whats right or wrong....=(

 

 

 

 

 

 

 

 

GrrrrrrrrrrrrrGrrrrrrrrrrrrr

Hi.

  Couple of questions:

       1. What is the return type on your formula (Text, Number, Date, etc)

       2. Can you explain in pseudocode what the formula is trying to do?  For example:   IF Organization_Type__c is "business/company" or "Photography/Art" AND belongs to Owner XYZ AND Lead is contacted AND is 14 days in the future THEN ... ... ...

       3. Is Organization Type a picklist field?

 

   When using AND you generally only use it once.  so the logic is as such:

                         AND(Organization_Type__c = "business/company", Owner = xyz)  but if the Organization Type is a picklist field, you need to add another section for that called ISPICKVAL. 

 

I can help you build the formula if you give me a little more info.  :)

 

-Temple

 

 

 

sourav046sourav046

Have you Activated the WF rule ?


The Formula you have made,is it giving any syntax error or saving fine ?

 

Make your requirement clear in normal language and tell us what you want to achieve actuallly....

gyip31gyip31
Hi, I tried to Activate the WF rule but I am getting a syntax error. The goal is to send an automatic email to contacted leads that have not been converted or modified after 14 days since the date of contact. We would like different email templates going to different leads based on the lead owner and a custom field labeled organization type. Them email templates have been created and are ready to go once i can get the WF rule going. Thanks! Gary
gyip31gyip31

 

1. Return type Text think? I'm trying to create time dependent WF rule that will automatically send an email.

2. The goal is to send an automatic email to contacted leads that have not been converted or modified after 14 days since the date of contact. We would like different email templates going to different leads based on the lead owner and a custom field labeled organization type. Them email templates have been created and are ready to go once i can get the WF rule going. 

3. Organization type is a Picklist field

 

As you can tell im a salesforce amateur learning.

 

Thanks for you help.

G

GrrrrrrrrrrrrrGrrrrrrrrrrrrr

Gary,
   Its kind of hard to get the exact formula right without knowing your information, but it would look something like this:

 

AND(OR(ISPICKVAL(Organization_Type__c, business/company"), ISPICKVAL(Organization_Type__c, "photography/art")), OwnerId="00530000007jMIb",  
ISPICKVAL(Lead_Status__c, "Working - Contacted"), Last_Modified_By__c = TODAY() +14)

 

Your AND statement

 AND(logical1,logical2,...) is evaluating all the things that your formula MUST equal true to in order to kick off the email.

 

Your OR statement is saying 

 OR(logical1,logical2,...) one of the two picklist values in Organization_Type__c can be selected to be true

 

 

Your ISPICKVAL statement

 ISPICKVAL(picklist_field, text_literal) evaluates a picklist and lets you select which item you are including in the formula field.

 

It might help to see it this way (this is the same formula above, just broken part for easier reading)

AND(

   OR(ISPICKVAL(Organization_Type__c, business/company"), ISPICKVAL(Organization_Type__c, "photography/art")),

OwnerId="00530000007jMIb",  
ISPICKVAL(Lead_Status__c, "Working - Contacted"),

Last_Modified_By__c = TODAY() +14)

 

Try this out, or a slight modification to it, and see if it works.  If not, you can write back with exact field types and I will test a formula for you in a sandbox.


--Temple

 

 

gyip31gyip31

Hey Grrrrrrrrrr,

 

I still get an syntax error Error: "Field Lead_Status__c does not exist. Check spelling" for (Lead_Status__c, "Contacted")

Here is the WF formula I'm using:

AND(OR(ISPICKVAL(Organization_Type__c, "business/company"), ISPICKVAL(Organization_Type__c, "photography/art")), OwnerId="00530000007jMIb",
ISPICKVAL(Lead_Status__c, "Contacted"), Last_Modified_By__c = TODAY() +14)

 

 

Here are my exact field types:

 

Custom Field: Organization_Type__c = Picklist

Standard Field: Lead Status = picklist

 

Here are the rule criteria, what missing in theory is Last_Modified_By__c = TODAY() +14):

 

(Lead: Organization TypeCONTAINSBusiness/Company,Photography/Art) AND (Lead: ConvertedEQUALSFalse) AND (Lead: Lead StatusEQUALSContacted)  AND (Lead: Lead OwnerEQUALSJulie Morgan)

 

 

Thanks again for the help. 

GrrrrrrrrrrrrrGrrrrrrrrrrrrr

Gary,

  Ok.  This is in the Lead Object.  So, the Lead Status fieldname is actually called "Status" in the background. 

  Also, Last Modified By is actually, LastModifiedBy and that is a lookup field for the name of the user that modified the record.  We need a date field to calculate the +14 days.

 

  You can add a date field to the LEAD object and call it Date Modified or something similar.  It would require any user to manually enter that date so you can calculate the last time the record was modified.  (Or you can create a workflow rule to trigger EVERY time a record is edited to do a field update that automatically adds the date for you). -- Formula for that is just TODAY()  Either way, you need someway to have a date you can calculate the time on.

 

AND(OR(ISPICKVAL(Organization_Type__c, business/company"), ISPICKVAL(Organization_Type__c, "photography/art")), OwnerId="00530000007jMIb",  
ISPICKVAL(Status "Working - Contacted")

 

You can start by removing the Last Modified By part to see if the rest of the formula is working.

 

Temple