You need to sign in to do that
Don't have an account?
jnegi
How to assign predefine date to CampaignMember's FirstRespondedDate .
Hi
As per my business requirement I am deleting my CampaignMember's record and creating new record. Now how can I set the same FirstRespondedDate in new records which were in deleted records.
If both deletion and creation of records are part of same transaction, then you can use the helpof a temporary Date variable.
You can declare date variable in class and use it to assign FirstRespondedDate and then use this variable to assign it to the new record to be created.
If this is not the case, then you have to create a temporary custom object and have to save date against any unique field of CampaignMembers record.
Thanks Imran
I want to ask how can I assign predefined date to FirstRespondedDate.
I am doing like this:-
CampaignMember cm = new CampaignMember();
cm.Status = 'responded';
when I am doing this it assign FirstRespondedDate as today's date. How can I assign predefined date to FirstRespondedDate through coding.
As you said that old records are deleted and new campaignmember records are created.
How is the FirstRespondedDate assigned in Old records.?
And one more question is is both deletion and new record creation happening at the same time.
FIrst Query:-
In CampaignMember there is a Status picklist field which have value as "Sent" and "Responded". When we select Responded another CampaignMember 's boolean field HasResponded set as true,which automatically set FirstRespondedDate.
Second Query:-
Yes both operations are happening at same time.