You need to sign in to do that
Don't have an account?
Dosbol T
Please help with post deployment code.
Hello,
I am trying to update all my leads which were created before I have added a new field. Now, after having all deployed onto UAT I need to perform post deployment action. But having an issue with the code, what is wrong with it?
I am trying to update all my leads which were created before I have added a new field. Now, after having all deployed onto UAT I need to perform post deployment action. But having an issue with the code, what is wrong with it?
For (List <Event> eventList: [SELECT Id, WhoId, TypeOf WHO WHEN Lead THEN FirstInterviewdate__c END, Subject, ActivityDate FROM Event WHERE Subject = 'First Interview' AND WHOID != null LIMIT 200]){ List<Lead> leadlist = new List<Lead>(); For(Event evt: eventList){ leadlist.add(new Lead (Id=evt.WhoId, FirstInterviewdate__c = evt.ActivityDate)); } update leadList; }and the issue is:
Can you explain more about your post deployment step?
what exactly you need to update in lead records?
Thanks!!
Sure. The field FirstInterviewdate__c is the new field which was added later. But we had already leads created before that field was added, now this is field is empty for those old leads. I need to update them with this code above.
Execute the below code in developer console.
If this helps, Please mark it as best answer.
Thanks!!
Thanks for your effort. Unfortunately, it did not work. I have slightly updated my own code, but it is not helping either. What is wrong?
when you executed my code, is there any error you are getting?