I have two rich text fields in different objects. We’ll call one is InteractionNote__c on the Interactions object, and the other CaseNotes__c, on the Case object. Interaction is a child of Case.
CaseNotes__c is a bulleted list of all of the InteractionNote__c fields from all of the Interactions in the Case.
Say that currently Case has three interactions, and CaseNotes__c looks like this:
<ul> <li>Note 1</li> <li>Note 2</li> <li>Note 3</li> </ul>
I need to write a script that will take the value of InteractionNote__c when a new interaction is saved (call it ‘New Note 4’), and dump it into CaseNotes__c so that the result is:
<ul> <li>Note 1</li> <li>Note 2</li> <li>Note 3</li> <li>New Note 4</li> </ul>
I think I need some jQuery to find the last and add
'<li>' + InteractionNote__c + '</li>
before it. Or find the last and add that after it?