GithubHelp home page GithubHelp logo

douglascayers / sfdc-convert-notes-to-chatter-notes Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 11.0 790 KB

📓 Easily migrate your Notes to Enhanced Notes.

Home Page: https://douglascayers.com/2017/05/08/convert-notes-to-enhanced-notes/

License: BSD 3-Clause "New" or "Revised" License

Apex 100.00%
convert-notes-to-enhanced-notes salesforce salesforce-notes

sfdc-convert-notes-to-chatter-notes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sfdc-convert-notes-to-chatter-notes's Issues

Weird behavior on migrating notes

I have just installed the app and triggered the Notes conversion. There are two things that are not clear to me:

  1. I have 709 Notes in my Org and upon submitting the conversion in setup=>monitoring=>apex jobs I see 709 batches but it only gets to 592 and there stops. Status is processing but it never progress from 592. Am I missing something?
  2. This one is realy weird. After I submitted the conversion and Job comes to 592 processed batches, I can see the new Notes in the Notes Related List. If I enter them I can clearly see it is the new one. However, I still don't have any ContentNote in the Org. select count() from contentnote returns 0. Contentnote is the new Note, right?

Thank you in advance
Marko

Install Failed: Dependent class is invalid and needs recompilation

When I try and install the app into a sandbox environment I get this error:

Dependent class is invalid and needs recompilation: Class
dca_cnvrt_note.ConvertNotesToContentNotesBatchable : Dependent class is invalid and needs recompilation: Class dca_cnvrt_note.ConvertNotesToContentNotesService : Field is not writeable: ContentVersion.CreatedById

Any ideas what I can do to fix it?

Newlines being converted to <br> text

I'm using your excellent tool to auto-convert Notes that are being received via a Slack integration as plain text.
Unfortunately, text that contains newline characters are being converted to
text, and are showing up like that in the new Enhanced Note
eg
Test message
after newline

after two newlines

Comes through in the converted Note as
Test message
after newline

after two newlines

Is there a specific character sequence or character I should insert into the old-style note that will be converted to a true newline in the converted note?
Thx!
iain

How to mass pull note ID's?

I have hundreds of notes that I need to convert, how am I supposed to pull the ID of every note in mass without having to go to each individual note to pull it when SF doesn't have the option to report on Notes & Attachments? Thanks!

Batches are failing

Great tool. Saved me a lot of time with data migration.

It seems successfully process a 1-3 batches and then stop. I have tried batch size of 1 and it processed 4 records. Batch size of 5 and 10 records. There are no triggers or automations.

ConvertNotesToContentNotesServiceTest fails if no Partner Community is enabled in the org

The ConvertNotesToContentNotesServiceTest.test_partner_community_users() method fails at line 25 when Communities isn't enabled in an org, because it can't find a Profile with the specified name. Error message is:

List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_partner_community_users: line 25, column 1

Instead of binding to a single sObject instance, it should bind to a collection and inspect if the collection is null, then branch / handle accordingly.

Cannot see item in log

Hi,
I am successfully able to convert around 94,000 notes. but for remaining 7000 notes i am not able to see them in either "Converted" or "Error" or "Skipped" related list. I am not able to trace why these 7000 notes are not getting converted.

What i have tried:
For debugging, i have supplied 1 note id and then tried running conversion.
Below is the debug log:

screen shot 2017-10-16 at 8 41 44 pm

P.S. this should have nothing to do with salesforce limits as i have already raised the limit by opening a case.

Share Private Notes to Parent Records

In Winter '18, Salesforce introduced new field ContentVersion.SharingPrivacy which mimics the same behavior as Note.IsPrivate.

Request that any private notes be converted and shared to parent record and use the new SharingPrivacy field to preserve privacy.

Reported by Jeff Issenberg

New Option: Max Daily Conversion Limit

Since Salesforce enforces a max of 36,000 ContentVersions published in a 24-hour period (can be increased to 50,000 by contacting support), then this poses a problem for orgs with more than 36,000 attachments to convert.

Summer '17 should be increasing the limit to 200,000 which will be a big help, but we still need way to mitigate running into whatever governor limit does exist.

Add new conversion option to limit the max number of attachments the batch job will try to convert in the current day. This will allow admins to throttle how many attachments they convert each day and try to stay under the governor limit.

Ability to report on conversions

As an admin converting notes, I need way to report on conversions to know which notes converted or failed to confirm expected results. Due to nature of Enhanced Note sharing model, only notes explicitly shared with me am I able to query.

Try to decipher System Error Codes

When the batch job fails to convert due to:

Note cant be saved because it contains HTML tags or unescaped characters that are not allowed in a Note.

The system generated apex exception email for the managed package only says:

Salesforce System Error: 623811003-63707 (123133497) (123133497)

I'm not sure if this error code always means this reason, but if so perhaps try to capture this error code so a meaningful message can be added to the log record.

Inactive owners

HI Doug,

As you have mentioned on your posts I have updated all the inactive owners of the notes to an active owner as a pre step but still am receiving 'This user is inactive' error message.

I was looking at the 'ConvertNotesToContentNotesService' class and noticed below lines(#79,#80) of code where we are setting the owner of the contentNote to be same as whoever has created the Note.

ownerId = note.createdById, // system requirement, owner and creator must be the same
createdById = note.createdById,

In this case should not we change the code to below lines of code?( if we dont then createdByid is still an inactive user as we just updated the owner to be active)

ownerId = note.OwnerId, // system requirement, owner and creator must be the same
createdById = note.OwnerId,

I have updated the code in the class manually myself but am still receiving the same error message. I have also given the user permission to 'Update Records with Inactive Owners'.

I would appreciate if you could please check those two lines of code and let me know if I am missing something.

Note Not Editable After Conversion

I just created an old note, and used the tool to convert the single ID (Opportunity). It worked perfectly, but I just realized that I can now no longer edit the Enhanced Note. Did I miss something?

Test failing - Partner Community

Deployment CompleteTest failure, method: ConvertNotesToContentNotesServiceTest.test_partner_community_users -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_partner_community_users: line 24, column 1

Hello, I'm getting the above error and have tried a number of things to resolve it, but have been unsuccessful. We have a partner community enabled in this org. Is there a quick fix to this problem?

Been running process for days but now get Salesforce System error

Hi,

I have been using the Notes to Enhanced notes conversion app and been doing 2000 conversions in a 24 hour period including deleting the old note as it goes to the Enhanced notes. Come the batch count left at 100 but it will no longer process. I get the same issue in both Production and Testing sandbox(full).

Error is : Salesforce System Error: 1439474981-49883 (123133497) (123133497)

It will no longer process any batches. I have turned off delete and also sent a batch with 1 record and it takes a while to process and then shows this error.

Any help would be appreciated. Trying to convert the notes by end of month or ASAP.

Thanks

Mike

Can't install getting an error

NEVER-MIND: Was installing in the wrong org, it would be great for people that work in many orgs if before you install it displays what org it's trying to install into.

I have gone through the instructions and have enabled notes in settings, and checked off Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions, I also created a permission set to assign the to me. I am getting this error still.... Any suggestions?
screen shot 2018-01-12 at 12 55 00 pm

Warn about non ASCII characters

Per John Lee,

Initially, I looked for those characters (¢ © ® ™). In the end, had to look for all non-ASCII characters and either deleted them or converted to some other ASCII character.

This is the regex I used to find all non-ascii characters "[^\x00-\x7f]" (everything in the double quotes) when I was searching in Excel.

The characters ranged from Chinese, non-printable, emoji, bullets, to MS Word smart quote characters.

Try to inspect Note content for non ascii characters that would cause Note conversion to fail and skip it so user knows to review those records. Give option in app to skip notes that may fail or attempt to convert anyways.

I want to track notes conversion in a large org.

Hello!

We are trying to convert classic notes to enhanced notes using your plug in. Which initially worked awesome. But now I am experiencing some issues and I was wonder if you could please help me with that:
Is there a way to track which records have been converted?
We have 2 million notes to be converted. We have been running the tool for several days now (because of SFDC limits) At the beginning we could see the progress (number of batches processed in apex jobs) but now it just stops (and after several hours of inactivity, I get an error: Salesforce System Error: 1956974305-450 (123133497) (123133497))
Also, is there a way to query converted notes? If I open parent records in the UI, I can see the new notes, but if I query ContentNote, I cannot see them.

Any thoughts?
Thanks in advance,
Pam

Thank you!

Hi Doug,

First, I want to say thank you for all of the hard work that you do!

I am trying to push this into salesforce from github and am getting this error:
Deployment CompleteTest failure, method: DeleteBatchTest.coverageAll -- System.AssertException: Assertion Failed: Expected: 0, Actual: 3 stack Class.DeleteBatchTest.coverageAll: line 29, column 1

Am I doing something to cause this? Thank you again!

All notes not getting converted

Hello, Doug Ayers.

I really loved the app. I tried a record or two initially to convert into Notes from Notes and Attachments.
Then, i submitted a request for conversion of notes of around 10k accounts and then i randomly checked the Account IDs to see if all the notes got converted.

I could see only 500 account IDs which have the notes got converted and i don't see any error in the log.

Please guide me on the same.

Note body is empty

I have found there is an issue when the original note body is empty. The enhanced note is then created with "

" as the new note text. There are some people at our organization that created notes with only the subject.

Salesforce System Error: 208410828-86802 (1615802660)

Hello Doug,
I am having an issue with conversion and hoping you can help me.
When doing a test conversion (all records, ~26000) in the sandbox, the apex job hangs at one point, stays like that for a couple of hours and then errors out:
Salesforce System Error: 208410828-86802 (1615802660) (1615802660)

I've contacted SFDC support to figure out what this error means and they advised that this is the same error when the note contains HTML or invalid characters.
Unfortunately, no log is created about the problematic record.
Would there be a way to pinpoint what record is causing this problem?
Thank you in advance!
Gabor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.