• Agi
  • NEWBIE
  • 330 Points
  • Member since 2013

  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 65
    Replies
I'm trying to write a formla for a text field.  We have a "Communication Preference Confirmed" text field that I would like to show "Recieved" if the "Communication Opt In " check box = True OR if the Email Opt Out = True

ALSO

We would also like the "Communication Preference Confirmed" text field to show "Required" if the "Communication Opt in"  checkbox is blank and the "Email Opt Out" = False

Thanks!
I wrote a validation rule on the case object, worked fine for sys admins, but for standard users it always evaluated to true:

NOT(ISPICKVAL(Status,'Closed')) &&
IF( AssetId <> NULL, Asset.AccountId <> AccountId, false)

I wrote 2 others, that didn't ever evaluate to true:


NOT(ISPICKVAL(Status,'Closed')) &&
IF( NOT(ISBLANK( AssetId )) ,
Asset.Account.Name = Account.Name,false)


NOT(ISPICKVAL(Status,'Closed')) &&
IF(AssetId <> NULL,
If( AccountId <> NULL,
Asset.Account.Name <> Account.Name,false), false)


What don't any of these work? What should the rule say??
User-added image

I need the "Former Customer Notes" field (which is a text field) to become required when the "Former Customer" field (picklist)  is marked "Yes." What is the formula to do this?
Hello Everyone,

  I have a strange scenerio that I am not sure is possible.  What I am trying to do is take a date/time field and a number field and get another date time field.  So the use case is the client has a start date and time (date/time field) and a the duration (number field) the duration is the total hours worked.  The idea is to get the end time from the start date and time and the duration.  Now I if this does not work I may propose trying to use two date/time fields to get the duration.  If that is easier what would the formula be for the duration field.  Thank you for your help.  
I need some help with my workflow rule formula. Idea is when this Installation Completion date is once set and if someone changes the date after that I'll get an email alert that this field is updated.

Now I've made the email templates,alerts and started working on my workflow rule and this is what I've come up :

AND(ISCHANGED(Installation_Completion_Date__c))

and evaluation criteria is : Evaluate the rule when a record is created, and every time it’s edited

but I'm not sure how to put this part that alert goes off only when it has a date(old value) and the date changes(new value). Now whenever I put date to the field (even when I set the value for the first time) it sends me the email. 

  • March 04, 2014
  • Like
  • 0
I have a custom picklist field Status__c with 6 values ActiveA, ActiveB,ActiveC,ClosedP,ClosedQ,ClosedR


I am trying to write a Workflow rule such that when Status__c is changed from any of the Active values to the Closed values, populate the Closed_Date__c field with date today().


This is my workflow rule but it is giving syntax error
Error: Field Status__c is a picklist field. Picklist fields are only supported in certain functions.

AND(
ISCHANGED(Status__c), ISPICKVAL( PRIORVALUE(CONTAINS(Status__c,"Active"))), ISPICKVAL(CONTAINS(Status__c,"Closed"))
)
  • February 18, 2014
  • Like
  • 0
Hi, I have created a custom field on Case object  Last modified by owner date/time. I also created a formula field and a workflow rule to insert date and time whenever Only the Case Owner modify the status field. Now i am trying to create another workflow rule that if Case Owner doesn't modify case status with in 3 days then it should send  email notification to manager that the status of this case hasn't been changed by case owner in last 3 days. 

Can you Please help me with this Workflow rule and time dependent rule?
  • January 25, 2014
  • Like
  • 0

Hi,

 

I'm trying to calculate the week of month nd m failing with this approach.

 

MOD(FLOOR((StartDate__c - DATE(YEAR(StartDate__c),1,1)/7) + 26,52)+1)

 

what I actually want is suppose if I have 52 records created with the start date and end dates like.. 1st... 1/1/2014 to 8/1/2014. 2nd ... 8/1/2014 to 15/1/2014 and so on....

so I want to calculate that what is the number of week like.... 1st week , 2nd week and so on....

 

if anyone has the solution for this than please let me know .............. thanks in advance..... :)

  • December 05, 2013
  • Like
  • 0

Hey Guys, 

 

we have a validation rule on (xyz__c) field.. It's like this " whenever any change to a field (xyz__c) is made , users need to select the reasons in reason__c field.  But it is prompting the users to select the reasons (reason__c) whenever any change is made to any field on the that record. In short , validation rule should be valid only for xyz__c but it is working on all fields. Below is the validation rule. 

 

AND( 
$Profile.Id <> "00e70000000owrS", 
ISCHANGED(xyz__c ), 
TEXT(reason__c)="" 
)

 

 

Hi i'm trying to re-write this formula and having some syntax issue :(

 

Old rule condition was : if 1st established contact already contains a date, canot change it

 

New rule condition is as follow: If established 1st contact is WITHIN last 3 months, that date cannot be changed with exception for admin

 

 

Here is old formula without new condition

 

 

AND(
NOT($Profile.Name = "System Administrator"),
ISCHANGED(Established_1st_Contact__c),
NOT(
ISBLANK(
PRIORVALUE(Established_1st_Contact__c))))

 

 

If nayone can help, i would appreciate

 

 

Thx in advance

  • November 04, 2013
  • Like
  • 0

hi All,

i'm trying to put a hyperlink into the CEM parameter in a docusign custom buttom,
i've tried the below but it doesn't work..

<a href="link"><B>text</B></a> 
{!LINKTO(label, target,​ id, [inputs], [no override]}​ 
string.link("link") 

any help is much appreaciated:)
  • June 17, 2016
  • Like
  • 0
i'm looking to update custom picklists on opportunity when a sepcific user is sending an email with specific subject,
there are two user lookups on the opp, when the user in lookup A sends the email and the subject contains X, or user  B with subject Y, i'd like a picklist C or D to be updated with a value "in progress"

i found this but i cant modify to meet the above..

trigger TaskSubject on Task (after update, after insert) {
set<id> accountIdSet = new set<id>();
 
//capture all the subject names in a set
//set<string> subjectName = new set<string>{'financial review','legal precheck'};
map<id, list<opportunity>> opptyMap = new map<id, list<opportunity>>();
list<opportunity> updateOppList = new list<opportunity>();
 
//get those tasks where the tasks are related to opp, Capture the account IDs in a set.
for(task t: trigger.new){
            string tempId = string.valueOf(t.WhatId);
    if(tempId.startsWith('006')){
        oppIdSet.add(t.whatId);
    }   }
 
//If we get the opportunities then change the stage.
if(Trigger.isUpdate && opptyMap.size()>0){
    for(task t: trigger.new){
 
 //Check if the subject of the task is one among the set
 //and also confirm that the subject has been changed.
 
        if(t.subject != trigger.oldMap.get(t.id).subject && opptyMap.containsKey(t.whatId)){
 
  //iterate thru the list of the opportunity associated with that account
  //and check which of the opportunity contains the task subject in the
   //opportunity name and update the stage to qualification
 
            for(opportunity oppty: opptyMap.get(t.whatId)){
                if(oppty.name.contains(t.subject)){
                    oppty.stageName='Qualification';
                    updateOppList.add(oppty);
                }            }        }        }        }
if(Trigger.isInsert && opptyMap.size()>0){
     for(task t: trigger.new){
            if(opptyMap.containsKey(t.whatId)){
                for(opportunity oppty: opptyMap.get(t.whatId)){
                   if(oppty.name.contains(t.subject)){
                      oppty.stageName='Qualification';
                      updateOppList.add(oppty);
                   }              }            }         }        }
//update the oppties
if(updateOppList.size()>0){
    update updateOppList;
}     }

 
  • February 11, 2016
  • Like
  • 0
Hi Team,

can you please help me,
i receive an error message :
Error: Invalid Data.
Review all error messages below to correct your data.
The page you submitted was invalid for your session. Please click Save again to confirm your change.
 
for my custom button:
/00T/e?who_id={!User.Id}&retURL=%2FContact.Id&RecordType=xxxxxxxxxxxxxxx&ent=Task&tsk5=Validate Contact&tsk4={!DATE( YEAR(TODAY()),month( TODAY()),DAY(TODAY()+7))}&tsk2_lkid={!Contact.Id}&tsk2={!Contact.Name}&save=1&retURL={!Contact.Id}


the task should be saved with the prepopulated fields once clicked on the button,  but i've seen in several posts that save=1 stopped working.
Can any body please advise how to put the above into Javascript / onclick JavaScript custom button?

thanks in advance,
agi
  • January 27, 2014
  • Like
  • 0
i'm looking to update custom picklists on opportunity when a sepcific user is sending an email with specific subject,
there are two user lookups on the opp, when the user in lookup A sends the email and the subject contains X, or user  B with subject Y, i'd like a picklist C or D to be updated with a value "in progress"

i found this but i cant modify to meet the above..

trigger TaskSubject on Task (after update, after insert) {
set<id> accountIdSet = new set<id>();
 
//capture all the subject names in a set
//set<string> subjectName = new set<string>{'financial review','legal precheck'};
map<id, list<opportunity>> opptyMap = new map<id, list<opportunity>>();
list<opportunity> updateOppList = new list<opportunity>();
 
//get those tasks where the tasks are related to opp, Capture the account IDs in a set.
for(task t: trigger.new){
            string tempId = string.valueOf(t.WhatId);
    if(tempId.startsWith('006')){
        oppIdSet.add(t.whatId);
    }   }
 
//If we get the opportunities then change the stage.
if(Trigger.isUpdate && opptyMap.size()>0){
    for(task t: trigger.new){
 
 //Check if the subject of the task is one among the set
 //and also confirm that the subject has been changed.
 
        if(t.subject != trigger.oldMap.get(t.id).subject && opptyMap.containsKey(t.whatId)){
 
  //iterate thru the list of the opportunity associated with that account
  //and check which of the opportunity contains the task subject in the
   //opportunity name and update the stage to qualification
 
            for(opportunity oppty: opptyMap.get(t.whatId)){
                if(oppty.name.contains(t.subject)){
                    oppty.stageName='Qualification';
                    updateOppList.add(oppty);
                }            }        }        }        }
if(Trigger.isInsert && opptyMap.size()>0){
     for(task t: trigger.new){
            if(opptyMap.containsKey(t.whatId)){
                for(opportunity oppty: opptyMap.get(t.whatId)){
                   if(oppty.name.contains(t.subject)){
                      oppty.stageName='Qualification';
                      updateOppList.add(oppty);
                   }              }            }         }        }
//update the oppties
if(updateOppList.size()>0){
    update updateOppList;
}     }

 
  • February 11, 2016
  • Like
  • 0
HI
 i crete one formula field for find the age of student in that i wrote dis (YEAR(TODAY())-YEAR(DOB__c) Formula
 now i get age in years
next one more formula fiedls for months in that i wrote dis MONTH(TODAY())-MONTH(DOB__c) formula and days for DAY(TODAY())-DAY(DOB__c).
I get perfect answers but my requirement is in need years months days in one formula field ...
what formula i can write send answer any one please
Hi everybody,

I am looking for a solution how to express a formula for an user-defined field with the following description:

the formula should show the corresponding letter salutation dependent on the picklist values in fields Salutation and tthe Contact Language, for example:

- if you choose in the picklist Salutation "Mr." and the Contact Language is "English", the user-defined field will show for example the expression "Dear Mr. John Benson" for John Benson, in the user-defined field

- if you choose in the picklist Salutation "Mrs." and the Contact Language is "English", the user-defined field will show for example the expression "Dear Mrs. Diana Fox" for Diana Fox

- if you choose in the picklist Salutation "Herr" and the Contact Language is "German", the user-defined field will show for example the expression "Sehr geehrter Herr X Y" for X Y

- if you choose in the picklist Salutation "Frau" and the Contact Language is "German", the user-defined field will show for example the expression "Sehr geehrte Frau A B" for A B


I wrote this formula, which unfortunately is not working right:

if((ISPICKVAL(Sprache__c  ,"Deutsch") && (ISPICKVAL(Salutation  ,"Herr"))),"Sehr geehrter Herr" & FirstName & LastName)
if((ISPICKVAL(Sprache__c  ,"Deutsch") && (ISPICKVAL(Salutation  ,"Frau"))),"Sehr geehrte Frau" & FirstName & LastName) OR
if((ISPICKVAL(Sprache__c  ,"Englisch") && (ISPICKVAL(Salutation  ,"Mr."))),"Dear Mr." & FirstName & LastName) OR
if((ISPICKVAL(Sprache__c  ,"Englisch") && (ISPICKVAL(Salutation  ,"Mrs."))),"Dear Mrs." & FirstName & LastName)

The syntax error says "extra if"

witth CASE:

CASE((ISPICKVAL(Sprache__c ,"Deutsch")) && (ISPICKVAL(Salutation ,"Herr")),"Sehr geehrter Herr" & FirstName & LastName,
((ISPICKVAL(Sprache__c ,"Deutsch")) && (ISPICKVAL(Salutation ,"Frau"))),"Sehr geehrte Frau" & FirstName & LastName,
((ISPICKVAL(Sprache__c ,"Englisch")) && (ISPICKVAL(Salutation ,"Herr"))),"Dear Mr." & FirstName & LastName,
((ISPICKVAL(Sprache__c ,"Englisch")) && (ISPICKVAL(Salutation ,"Frau"))),"Dear Mrs." & FirstName & LastName)

it says: "incorrect argument type for CASE"

Can anybody please help me? what am I doing wrong?
Hello there,

I have a junction-like object of two lookup fields. Now I want those two fields to be read-only on their page layouts. How can I make it?

I used all ways like Page Layout, Field level security, Profiles, etc.

Please help.

Thanks in advance.
I'm trying to write a formla for a text field.  We have a "Communication Preference Confirmed" text field that I would like to show "Recieved" if the "Communication Opt In " check box = True OR if the Email Opt Out = True

ALSO

We would also like the "Communication Preference Confirmed" text field to show "Required" if the "Communication Opt in"  checkbox is blank and the "Email Opt Out" = False

Thanks!
I haven't received any help in formulas, so I'm thinking I might have asked in the wrong section! Thanks for looking.

We have a field "Lifetime__c", that we would like to show a summation of all hourly imported values (importing to "Imported__c"). A simple formula field seems circular (Lifetime__c + Imported__c = Lifetime__c). What is the best way to go about this? Is there a way to create a field that does not overwrite, but adds on? A better formula field? Triggers? Roll-Up Summary Fields??

The goal is to have Lifetime__c updated hourly with a numerical value being imported (and overwritten) hourly to Imported__c like thus:

Hour 0: Imported__c - 5 Lifetime__c - 5
Hour 1: Imported__c - 3 Lifetime__c - 8
Hour 2: Imported__c - 7 Lifetime__c - 15

Any insight would be greatly appreciated. Thanks!!!
We have a field "Lifetime__c", that we would like to show a summation of all hourly imported values (importing to "Imported__c"). A simple formula field seems circular (Lifetime__c + Imported__c = Lifetime__c). What is the best way to go about this? Is there a way to create a field that does not overwrite, but adds on? A better formula field? Triggers? Roll-Up Summary Fields??

The goal is to have Lifetime__c updated hourly with a numerical value being imported (and overwritten) hourly to Imported__c like thus:

Hour 0: Imported__c - 5 Lifetime__c - 5
Hour 1: Imported__c - 3 Lifetime__c - 8
Hour 2: Imported__c - 7 Lifetime__c - 15
etc...

Any insight would be greatly appreciated. Thanks!!!

Curently I have the following validation rule that requires the Billing Address field to be required. The issue I am having is it does not work when a user creates new Account. Only works after the Account has been saved and then is updated.  How to get the validation to apply  when a user creates a new Account?

AND (
      DATEVALUE( CreatedDate )  >=   DATEVALUE('2011-06-01'),
OR(
ISBLANK( BillingStreet ),
ISBLANK( BillingCity ),
ISBLANK( BillingState ),
ISBLANK( BillingPostalCode )
))
I wrote a validation rule on the case object, worked fine for sys admins, but for standard users it always evaluated to true:

NOT(ISPICKVAL(Status,'Closed')) &&
IF( AssetId <> NULL, Asset.AccountId <> AccountId, false)

I wrote 2 others, that didn't ever evaluate to true:


NOT(ISPICKVAL(Status,'Closed')) &&
IF( NOT(ISBLANK( AssetId )) ,
Asset.Account.Name = Account.Name,false)


NOT(ISPICKVAL(Status,'Closed')) &&
IF(AssetId <> NULL,
If( AccountId <> NULL,
Asset.Account.Name <> Account.Name,false), false)


What don't any of these work? What should the rule say??
User-added image

I need the "Former Customer Notes" field (which is a text field) to become required when the "Former Customer" field (picklist)  is marked "Yes." What is the formula to do this?
Hi,
I have an junction object with three lookup fields to three budget types (other objects). They are filled in depended on selected record type.
As result of formula I want to have 18 character Id.
Formula:
CASE(RecordType.Name,
'Product Budget', EMS_Product_Budget_gne__r.Id,
'Region Budget', EMS_Region_Budget_gne__r.Id,
EMS_Territory_Budget_gne__r.Id)

Compiled size: 523 characters. Great but it returns 15char Id. Lets use CASESAFEID()
CASESAFEID( CASE(RecordType.Name,
'Product Budget Allocation', EMS_Product_Budget_gne__r.Id,
'Region Budget Allocation', EMS_Region_Budget_gne__r.Id,
EMS_Territory_Budget_gne__r.Id) )

Error: Compiled formula is too big to execute (9,780 characters). Maximum size is 5,000 characters.
CASE(RecordType.Name,
'Product Budget Allocation', CASESAFEID( EMS_Product_Budget_gne__r.Id),
'Region Budget Allocation', CASESAFEID( EMS_Region_Budget_gne__r.Id),
CASESAFEID( EMS_Territory_Budget_gne__r.Id) )

Error: Compiled formula is too big to execute (8,374 characters). Maximum size is 5,000 characters

Why is it that expensive? Is there a way to wokaround this?



Since Assets don't allow for history tracking on fields, I am trying to create a long text field that tracks the values of these fields.  I have it pretty much worked out except for the picklist fields.  

Here is my Workflow Rule:
OR(
ISCHANGED( AccountId ),
ISCHANGED( ContactId),
ISCHANGED( SerialNumber ),
ISCHANGED( Serial_Number_2__c ),
ISCHANGED( Hardware_Status__c ),
ISCHANGED( Hardware_Model_iSC1__c),
ISCHANGED( Hardware_Model_iSC2__c )
)

Here is my Field Update:
"Asset changed from " +
PRIORVALUE(AccountId) +  "to " + AccountId + BR() +
PRIORVALUE( ContactId ) + "to " + ContactId + BR() +
PRIORVALUE( SerialNumber )+  "to " + SerialNumber + BR() +
PRIORVALUE( Serial_Number_2__c )+  "to " + Serial_Number_2__c + BR() +
PRIORVALUE( Hardware_Status__c ) + "to " + TEXT(Hardware_Status__c) + BR() +
PRIORVALUE( Hardware_Model_iSC1__c ) +  "to " +  TEXT(Hardware_Model_iSC1__c) + BR() +
PRIORVALUE( Hardware_Model_iSC2__c ) +  "to " +  TEXT(Hardware_Model_iSC2__c) + BR() + "by " + 
LastModifiedById +  BR() +
PRIORVALUE(Asset_History_Log__c)

The problem lies in the values the picklists are returning are not the actual PRIORVALUE, it is returning the picklist number(see bold below).
11to In Storage - New
1to ISC250-01P1227A
1to ISC250-01T2394A

Thoughts on how I can get the actual value to return?  Thanks,
We have a valdation rule which references a RecordTypeID. When I enter this ID into the URL is says 'Insufficient Privileges'. I have the system admin profile and access to development mode. Is there any way to locate a RecordTypeID in a mass search funcationality?
Hello,

We are attempting to group Contact Titles into a Roles Custom Contact Field.  Here is what we have so far:

The issue:  We want to add an IF(CONTAINS(Title, "AP"), "Finance",       BUT it is pulling in anything with AP in the title.  Is there a way to run the IF CONTAINS, and then an exception like but NOT(CONTAINS(Title, "SAP"  ??

Any ideas are appreciated!  Thanks!

IF(CONTAINS(Title, "Assistant"), "Assistant",
IF(CONTAINS(Title, "Basis"), "Other",
IF(CONTAINS(Title, "Supply Chain"), "Other",
IF(CONTAINS(Title, "Security"), "Other",
IF(CONTAINS(Title, "Chief Financial Officer"), "CFO",
IF(CONTAINS(Title, "VP Finance"), "CFO",
IF(CONTAINS(Title, "Vice President Finance"), "CFO",
IF(CONTAINS(Title, "Chief Information Officer"), "CIO",
IF(CONTAINS(Title, "Accountant"), "Finance",
IF(CONTAINS(Title, "Accounting"), "Finance",
IF(CONTAINS(Title, "CFO"), "CFO",
IF(CONTAINS(Title, "CIO"), "CIO",
IF(CONTAINS(Title, "VP IT"), "CIO",
IF(CONTAINS(Title, "Vice President IT"), "CIO",
IF(CONTAINS(Title, "IT"), "IT",
IF(CONTAINS(Title, "IT Manager"), "IT",
IF(CONTAINS(Title, "IT Director"), "IT",
IF(CONTAINS(Title, "Information Technology"), "IT",
IF(CONTAINS(Title, "CEO"), "CEO",
IF(CONTAINS(Title, "Chief Executive Officer"), "CEO",
IF(CONTAINS(Title, "Operations"), "Operations",
IF(CONTAINS(Title, "Operating"), "Operations",
IF(CONTAINS(Title, "COO"), "COO",
IF(CONTAINS(Title, "CTO"), "CTO",
IF(CONTAINS(Title, "Chief Technology Officer"), "CTO",
IF(CONTAINS(Title, "Chief Technical Officer"), "CTO",
IF(CONTAINS(Title, "VP Technology"), "CTO",
IF(CONTAINS(Title, "Vice President Technology"), "CTO",
IF(CONTAINS(Title, "Information Systems"), "CTO",
IF(CONTAINS(Title, "Sales"), "Sales",
IF(CONTAINS(Title, "Human Resources"), "HR",
IF(CONTAINS(Title, "Procurement"), "Procurement", NULL))))))))))))))))))))))))))))))))
Hi, I have a simple report and I would like to know how can I convert a number column into time format (hh:mm:ss)?

I have a column (number) that is calculated in mins and I would like to show as time format (hh:mm:ss) in my report instead of whole number.

For example,
- 45 will show 00:45:00,
- 65 will show 01:05:00

is there any formula rules in report can do this?

Hi, I have a problem with my formula which should count End Date from Start Date + Contract Term, but the problem is that Contract Term values are not always divisible by 12? For example (37 or 41) .

Here is my formula before I found out that all the values aren't divisible by 12:

DATE(
(YEAR(Service_Contract_Period_Start_Date__c)+VALUE(TEXT(Service_Contract_Term__c ))/12),
MONTH(Service_Contract_Period_Start_Date__c),
DAY(Service_Contract_Period_Start_Date__c)
)

How should I solve this ?
Please add a field to the Visit object, but do not add it to any of the layouts, called " GP Margin Range " . This field needs to auto populate as one of the following ranges: " 0-30%, 30-40%, 40-50%, 50%+ ", based on the value in the Estimated GP Margin field.

E.G. if the Estimated GP Margin is 43% the GP Margin Range should be 40-50%.
I would appreciate any ideas of suggestions for writing a Fomula that looks at two fields (Date/Time Fields) and then sets a Text value (maybe  a Case statement) of "Day Shift" or "Night Shift" as follows:

Day Shift = 6 am to 6 pm (with same day)
Night Shift = 6 pm to 6am (across 2 days)

Thanks in advance for any ideas about ways to do this.

Sean
  • May 19, 2014
  • Like
  • 1
I need to create several validation rules off the back of the same process - we have a picklist and we need to enforce that if A, B or C are selected from A, B, C, D or E, that another field on the page becomes mandatory. I cannot find any code anywhere to create this and am struggling with the CASE and ISPICKVAL functions. Can anybody help? Thanks so much,
I am trying to prevent my users from skipping stages.  I have created this rule but I keep getting errors.  Can someone help me?
OR(and(
    ispickval<>(priorvalue(stage), "Presented Program")
   ,ispickval(stage,"Statement Collected")
),and(
    <>ispickval(priorvalue(stage), "Statement Collected")
   ,ispickval(stage,"Statement Analyzed")
),and(
    <>ispickval(priorvalue(stage), "Statement Analyzed")
   ,ispickval(stage,"Analyzer Presented")
),and(
    <>ispickval(priorvalue(stage), "Analyzer Presented")
   ,ispickval(stage,"Closed Won")
))