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
Craig WoodmanCraig Woodman 

LeadorContactId field on campaign member suddently not accessible

I am working with an Org, and I have used the LeadOrContactID standard field on Campaign Member as a convinient lookup to a campaign member without having to have a decision element to determine which type of ID is being used, and to do a seperate lookup.

I have this on one flow that is around 10 months old, and has been working perfectly.  I needed another flow on Campaign Member yesterday, so I used it again.  I completely tested and it was working fine as of yesterday end of day.

At about 10:30 this morning, I began getting users emailing about errors with records that involved both of these flows that could not save because of an error.  When digging in to it, I found that the Lookup portions of the flow were failing, becasue the flow could not find a Campaign Member record when using the LeadOrContactID as one of the criteria.

So I figured I would create a custom LeadOrContactId field, using a formula field. I verified on the page layout that the field is returning the correct lead or contact ID.  But the flow still fails, for the same reason - It looks like it cannot be used as the criteria for lookup.

I re-crafted both flows with decision elements to take care of this.

Any idea why both flows would quit so suddenly?
ShirishaShirisha (Salesforce Developers) 

Hi Craig,

Greetings!

It could be the data issue while dealing with the different records.So,can you please provide us the exact error message(which you got in the mail) to confirm the root cause.

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.

Warm Regards,
Shirisha Pathuri

Craig WoodmanCraig Woodman
Of course!  This error occurred when the flow tried to look up records: An unexpected error occurred. Please include this ErrorId if you contact support: 97231088-13403 (-548403183). 
ShirishaShirisha (Salesforce Developers) 
Hi,

It is not possible to check the exact error with the provided Gack Id as the issue is with the flow.

So,can you please copy paste the complete email content to check the flow of the execution and assit you.

Also,in future if you see any issues with the Process builder or flow the I would suggest you to create the debug logs with the finest on Workflow rules to capture the logs which will give you the complete execution which will give you an idea on the root cause of the issue.

Thank you!
Craig WoodmanCraig Woodman
I am happy to do this.  Just to let you know, a campaign member record DOES exist for this, and when I changed the flow to lookup by the ContactId, the flow worked and assigned as necessary.

Flow Details
Flow API Name: Task_Set_date_of_last_Communication_activity_for_campaign_member
Type: Autolaunched Flow
Version: 1
Status: Active
Org: STARC Systems (00D410000007oad)

Flow Interview Details
Interview Label: Task - Set date of last Communication activity for campaign member 5/1/2020 9:53 AM
Current User: Erin Buehler (0052M000008dFHq)
Start time: 5/1/2020 9:53 AM
Duration: 0 seconds

How the Interview Started
Erin Buehler (0052M000008dFHq) started the flow interview.
Some of this flow's variables were set when the interview started.
varTaskId = 00T2M00003i2zyFUAQ

FAST LOOKUP: Task_Information
Find all Task records where:
Id Equals {!varTaskId} (00T2M00003i2zyFUAQ)
Store the values of these fields in Task_Information: WhoId, OwnerId, Id
Result
Successfully found records.

FAST LOOKUP: Matching_Campaign_Members
Find all CampaignMember records where:
LeadOrContactId Equals {!Task_Information.WhoId} (0032M00002gZwppQAC)
Store the values of these currently referenced fields in Matching_Campaign_Members: Last_Sales_Activity_By__c, Last_Sales_Activity_Date__c, Id
Because Matching_Campaign_Members is passed to an action, subflow, or Lightning component, store the values of all CampaignMember fields that the running user has acces to.
Result
Failed to find records.
Craig WoodmanCraig Woodman
Certainly:

Flow Details
Flow API Name: Task_Set_date_of_last_Communication_activity_for_campaign_member
Type: Autolaunched Flow
Version: 1
Status: Active
Org: STARC Systems (00D410000007oad)

Flow Interview Details
Interview Label: Task - Set date of last Communication activity for campaign member 5/1/2020 9:53 AM
Current User: Erin Buehler (0052M000008dFHq)
Start time: 5/1/2020 9:53 AM
Duration: 0 seconds

How the Interview Started
Erin Buehler (0052M000008dFHq) started the flow interview.
Some of this flow's variables were set when the interview started.
varTaskId = 00T2M00003i2zyFUAQ

FAST LOOKUP: Task_Information
Find all Task records where:
Id Equals {!varTaskId} (00T2M00003i2zyFUAQ)
Store the values of these fields in Task_Information: WhoId, OwnerId, Id
Result
Successfully found records.

FAST LOOKUP: Matching_Campaign_Members
Find all CampaignMember records where:
LeadOrContactId Equals {!Task_Information.WhoId} (0032M00002gZwppQAC)
Store the values of these currently referenced fields in Matching_Campaign_Members: Last_Sales_Activity_By__c, Last_Sales_Activity_Date__c, Id
Because Matching_Campaign_Members is passed to an action, subflow, or Lightning component, store the values of all CampaignMember fields that the running user has acces to.
Result
Failed to find records.
Craig WoodmanCraig Woodman
Well, kind of odd.  Doing another flow today on Campaign Members - Tried a test using the Lead or Contact ID field - and it seems to read correctly for now. Did something happen? 
Kyle WinderKyle Winder
I'm having the same issue... comparing an Id string to LeadOrContactId on the campaignMember does not work.  did you find a resolution?
Craig WoodmanCraig Woodman
It seems to be very hit and miss. At times it has failed, but it is impossible to predict when. I have used a formula field for Lead Or Contact to do the same thing and it will work.