Tuesday, November 19, 2019

How to Convert Salesforce Classic Notes into Lightning Notes

As now everyone is migrating to Lightning, Salesforce supports lightning Notes(ContentNote) instead of Classic Notes. So while migrating to lightning, we have to convert all classic Notes to lightning Notes. Salesforce provide an appexchange app called magic mover for this purpose.

If you don't want to install this app and would like to perform this conversion, then you can do it with very simple apex script.

If you want to understand How to Convert Salesforce Attachments into Salesforce Files then refer below URL:

Convert Salesforce Attachments into Salesforce Files


I have created a batch class which will convert all Notes related to object (based on query that you pass) to ContentNote and you will receive an email with all details once batch job is completed.

Suppose you want to convert all the notes related to Account to Lightning Notes, then use below script in execute anonymous in developer console.

string qstring='Select id from Account';
SK_ConvertNotesForLightningBatch newjob= new SK_ConvertNotesForLightningBatch(qstring);
database.executeBatch(newjob);

Below is snapshot of csv file which you receive after this batch job completed.

Hope this will help!!

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete