• Chandra@Atlanta
  • NEWBIE
  • 65 Points
  • Member since 2018

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 33
    Replies
I have two fields RegFrom__c and RegUntil__c.

I would like to calculate how many calendar years there are between 2 dates WHERE:

CertRegFrom__c= 01-06-2018
CertRegUntil__c = 02-06-2023

This is a period of 5 years, but 6 calendar years, so result of the formula should be 6, the formula below returns 5. 

between the dates above you have the following calendar years 2018, 2019, 2020, 2021, 2022, 2023.

If CertRegFrom = 01-01-2018 AND CertRegUntil = 31-01-2022 then the formula must equal = 5
 
(CertRegUntil__c - CertRegFrom__c) /365

Can anyone help me adapt this formula?

Dave
Hello,
My challenge for   Admin Intermediate > Lightning Flow  > Automate Simple Business Processes with Process Builder fails with errors.
Below is the email that I received.
Can someone help?
Thanks in advance.
Cheers.
Jacques
Here is the message I received from Trailhead.
Challenge not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0010X00004CxrMNQAZ; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “keep contact addresses sync” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: FIELD_CUSTOM_VALIDATION_EXCEPTION: Contact must be in Account ZIP Code. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 138353171-26705 (1404636802): []

Here is the email I received from SalesForce:

Error element myRule_1_A1 (FlowRecordUpdate).
The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Contact must be in Account ZIP Code. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Contact must be in Account ZIP Code. You can look up ExceptionCode values in the SOAP API Developer Guide.

Flow Details
Flow Name: keep_contact_addresses_sync
Type: Record Change Process
Version: 1
Status: Active
Org: looking4job (00D0X000000NIfC)

Flow Interview Details
Interview Label: keep_contact_addresses_sync-1_InterviewLabel
Current User: Jacques CONAN (0050X0000076z7s)
Start time: 7/2/2018 4:05 PM
Duration: 0 seconds

How the Interview Started
Jacques CONAN (0050X0000076z7s) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 0010X00004CxrMNQAZ
myVariable_current = 0010X00004CxrMNQAZ

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!$Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "7/2/2018 4:05 PM"

DECISION: isChangedDecision2_myRule_1_ShippingCity
Executed this outcome: isChangedRule_2_myRule_1_ShippingCity
Outcome conditions: and
1. {!myVariable_old} (0010X00004CxrMNQAZ) Is null false
2. {!myVariable_old.ShippingCity} (null) Does not equal {!myVariable_current.ShippingCity} (Staines)
Logic: All conditions must be true (AND)

DECISION: isChangedDecision3_myRule_1_ShippingCountry
Executed this outcome: isChangedRule_3_myRule_1_ShippingCountry
Outcome conditions: and
1. {!myVariable_old} (0010X00004CxrMNQAZ) Is null false
2. {!myVariable_old.ShippingCountry} (null) Does not equal {!myVariable_current.ShippingCountry} (UK)
Logic: All conditions must be true (AND)

DECISION: isChangedDecision4_myRule_1_ShippingGeocodeAccuracy

DECISION: isChangedDecision5_myRule_1_ShippingLatitude

DECISION: isChangedDecision6_myRule_1_ShippingLongitude

DECISION: isChangedDecision7_myRule_1_ShippingState
Executed this outcome: isChangedRule_7_myRule_1_ShippingState
Outcome conditions: and
1. {!myVariable_old} (0010X00004CxrMNQAZ) Is null false
2. {!myVariable_old.ShippingState} (null) Does not equal {!myVariable_current.ShippingState} (Middlesex)
Logic: All conditions must be true (AND)

DECISION: isChangedDecision8_myRule_1_ShippingStreet
Executed this outcome: isChangedRule_8_myRule_1_ShippingStreet
Outcome conditions: and
1. {!myVariable_old} (0010X00004CxrMNQAZ) Is null false
2. {!myVariable_old.ShippingStreet} (null) Does not equal {!myVariable_current.ShippingStreet} (1 Street)
Logic: All conditions must be true (AND)

DECISION: isChangedDecision9_myRule_1_ShippingPostalCode
Executed this outcome: isChangedRule_9_myRule_1_ShippingPostalCode
Outcome conditions: and
1. {!myVariable_old} (0010X00004CxrMNQAZ) Is null false
2. {!myVariable_old.ShippingPostalCode} (null) Does not equal {!myVariable_current.ShippingPostalCode} (TW18 3AG)
Logic: All conditions must be true (AND)

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: or
1. {!isChangedRule_2_myRule_1_ShippingCity} (true) Equals true
2. {!isChangedRule_3_myRule_1_ShippingCountry} (true) Equals true
3. {!isChangedRule_4_myRule_1_ShippingGeocodeAccuracy} (false) Equals true
4. {!isChangedRule_5_myRule_1_ShippingLatitude} (false) Equals true
5. {!isChangedRule_6_myRule_1_ShippingLongitude} (false) Equals true
6. {!isChangedRule_7_myRule_1_ShippingState} (true) Equals true
7. {!isChangedRule_8_myRule_1_ShippingStreet} (true) Equals true
8. {!isChangedRule_9_myRule_1_ShippingPostalCode} (true) Equals true
Logic: One condition must be true (OR)

RECORD UPDATE: myRule_1_A1
Find all Contact records where:
AccountId Equals {!myVariable_current.Id} (0010X00004CxrMNQAZ)
Update the records’ field values.
MailingCity = {!myVariable_current.ShippingCity} (Staines)
MailingCountry = {!myVariable_current.ShippingCountry} (UK)
MailingGeocodeAccuracy = {!myVariable_current.ShippingGeocodeAccuracy} (null)
MailingLatitude = {!myVariable_current.ShippingLatitude} (null)
MailingLongitude = {!myVariable_current.ShippingLongitude} (null)
MailingPostalCode = {!myVariable_current.ShippingPostalCode} (TW18 3AG)
MailingState = {!myVariable_current.ShippingState} (Middlesex)
MailingStreet = {!myVariable_current.ShippingStreet} (1 Street)
Result
Failed to update records that meet the filter criteria.

Error Occurred: The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Contact must be in Account ZIP Code. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Contact must be in Account ZIP Code. You can look up ExceptionCode values in the SOAP API Developer Guide.


Salesforce Error ID: 138353171-26705 (1404636802)
 
Hi,
 
I created aTimeBased workflow rule cri
I have created a workflow "Common Expiring Handling" should automatically expire all records one day after the agreement end date. It works well for all new records and existing records. However for few existing workflow rule is not firing. 

I have followed already instruction available via below knowledge article but still relevant records will be not triggered as expected evne if criteria are met.
https://help.salesforce.com/articleView?id=000214139&type=1 
 my rule criteria is:
AND(Apttus__Contract_End_Date__c < TODAY(), Apttus__Auto_Renewal__c = False, ISPICKVAL( Apttus__Status__c , 'Activated')) || ( WF_Trigger__c = True)

Please do the needful 
Thanks in Advance!!
Can anyone help me with this issue that I'm facing when trying to run an Async SOQL qeury through Workbench. I keep running into this error message which is notifying me that I do not have permission to query the Custom_Object__c with Async SOQL.

I have the System Admin profile and I have full access to the Custom_Object__c in question along with full access to all of the fields.
Hi Everyone, 
I'm trying to create a rule that requires that shipping/mailing postal codes must match for all contacts with accounts. I'm getting syntax errors that don't make sense (like 'found extra AND' or 'found extra NOT'). Can anyone tell me what I'm doing wrong here? 

AND (
NOT(ISBLANK(AccountNumber))
NOT(Account.ShippingPostalCode = MailingPostalCode)
)
The error I got here is 
SELF_REFERENCE_FROM_TRIGGER, Object is currently in trigger AccountTrigger, therefore it cannot recursively update itself: []: Class.classname.automateAccOwnership: line xx, column 1
public static void automateAccOwnership(Account[] updatedAccounts){
            set<id> accIds = new set<id>();
            for(account acc:updatedAccounts){
                if(!acc.Account_Team_Exception__c) accIds.add(acc.id);
            }
    Map<id, user> userMap = new map<id,user>([select id, name from user where isActive=true]);
          
            
             list<account> accWithTeam= new list<account>([select id,name, checkbox1__c,type,Account_Team_Exception__c,(SELECT AccountAccessLevel,AccountId, Id,TeamMemberRole,UserId FROM AccountTeamMembers) from account  where id in:accIds]); 
           
            for(account acc: accWithTeam){
                for(AccountTeamMember ATM : acc.AccountTeamMembers ){               
            
        if(acc.checkbox1==true  && atm.TeamMemberRole=='RSD-BPSTN/CPSTN' ) {                        
                        acc.ownerid = atm.UserId ;
                        }                      
            }
           if(acc.type=='Reg Co - Tax Haven' ){ 
        
           for(user user:userMap.values())if(user.name== 'username') 
           acc.ownerId = user.id;             
             }     
          }  
     update accWithTeam; // this update statemet causing recursion

I appreciate your help.
Thank you.
I have two fields RegFrom__c and RegUntil__c.

I would like to calculate how many calendar years there are between 2 dates WHERE:

CertRegFrom__c= 01-06-2018
CertRegUntil__c = 02-06-2023

This is a period of 5 years, but 6 calendar years, so result of the formula should be 6, the formula below returns 5. 

between the dates above you have the following calendar years 2018, 2019, 2020, 2021, 2022, 2023.

If CertRegFrom = 01-01-2018 AND CertRegUntil = 31-01-2022 then the formula must equal = 5
 
(CertRegUntil__c - CertRegFrom__c) /365

Can anyone help me adapt this formula?

Dave
Hi all,
A question really makes me confused recently, could anyone help me?
As we known, the default maximum length of SOQL WHERE clause is 4000 characters. I want to know Apex will hwo to calculate the length of SOQL WHERE clause when we bind variables in it, especially collection type variable, such as List and Set type.
For example, we define a list variable like List<Integer> list1 = new List<Integer>{1, 2, 3, 4, 5, 6, 7};

SOQL1: SELECT XXX FROM XXX WHERE XXX IN: list1
SOQL2: SELECT XXX FROM XXX WHERE XXX IN (1, 2, 3, 4, 5, 6, 7)

SOQL1 equals SOQL2, what about the length?

Steven
Hi, 
I am new to salesforce and I am still trying to learn. I have a question regarding child queries.
Within my Leads object I have a field called Lead Status (API name: Status). A user can have many leads, and I was wondering how i can query it so that I know how many lead status = new for a certain user. Basically I want to look into a user that contains a list of lead status = new. thanks.
can we use formula field in SOQL query?If yes, please give a example. 
Thanks.

Hi All,
Urgent suggestion needed!!


I am new to Salesforce and have a requirement to prevent user to create the duplicate record and it should work for bulkyfication as well.

Please find the screenshot below of the Ticket Object detail page. The requirement is that there should be validation if user try to create duplicate records for same(Customer, username,email-id) and within the period of Start date & End Date.
You can create the duplicate records if the start date & End date is before or after the existing record.

-->In order to explain this better, I want to apply a condition that user cannot create duplicate Ticket if the Start date or End date lying the in the existing record.

for ex-  if u have this entry in your DB
->NYC Concert John Smith John@gmail.com John@gmail.com 25 3/20/2018 3/25/2018
Now you tried to Enter below. It Should Fail
->NYC Concert John Smith John@gmail.com John@gmail.com 25 3/21/2018 3/25/2018  Fail
->NYC Concert John Smith John@gmail.com John@gmail.com 25 3/23/2018 3/28/2018  Fail
->NYC Concert John Smith John@gmail.com John@gmail.com 25 3/26/2018 3/27/2018  Pass
->NYC Concert John Smith John@gmail.com John@gmail.com 25 3/18/2018 3/19/2018  Pass






Key Values to check duplicacy is Username, Customer,  Email Id, StartDate, End Date
It should support bulkyfication.

Duplicate Prevention
 

Hello, I want to figure out the best way to send automated emails to customers letting them know their certification with my company is about to expire. I have created email templates for 6 months, three months, 1 month etc. And I created a formula field that caculates the expiration date of their certification. I cannot figure out a way to setup a workflow rule to check whether the expiration date is less than 6 months away, 3 months, etc. Am I using the wrong part of salesforce to do this? Or do I need to rethink how I am determining the certification expiration dates and how workflow rule should monitor them? I thought about setting up an apex trigger that checks on the expiration dates whenever someone creates or edits a contact. But the issue is I have existing dates that would never be checked if I did that. 
Hi, 
I have two picklist Country and other Division. I want to update Division picklist based country
I stored Maping table on Custom metadata object and now I need update Division field based on Country by reffering Custom Metadata Object.
Can anyone help me with that.

Thanks