I was asked another question recently ……… this time it was about how to implement notes within Unified Service Desk (USD).
Again the Microsoft base sample package does contain an example of how notes work. It allows you add notes to cases.
The Microsoft example updates the notes from an agent script. In my example, I’ll assume you might not use agent scripts so I’ll implement the capability from a navigation toolbar. But whichever approach you implement to trigger the update of notes the hosted controls / actions involved would remain the same.
In my example I will give a toolbar button to update the notes on contact, but this approach can easily be applied to any entity that supports notes.
The steps involved are;
- Create hosted control for notes.
- Create action call load notes.
- Load the notes control in left panel.
- Create actions to “grab” and create notes.
- Create toolbar button
Step One – Create hosted control for notes.
First of all, if you haven’t got one already you’ll need to create a “special” hosted control to show the notes dialogue in the left panel. (Or right if you prefer!) Mine is shown below. Notice how the USD Component Type is “User Notes”.
Step Two – Create action call load notes.
Next, if it doesn’t exist, create a action to load the note. This is quite straight forward and will relate to the hosted control you just created. You just need to create an action call for its default action.
Step Three – Load the notes control in left panel.
Now you will need to ensure the notes control shows in the left panel of whatever entity you are working with. So in this example “contact”. Simply go to the hosted control for the entity you are working with, locate the events in navigation. Then on a “BrowserDocumentComplete” event add the action call we mentioned earlier to create the note. Example shown below.
Step Four – Create actions to “grab” and create notes.
Now create two actions, the first “grabs” the notes information. (Mine is below.) The order is significant. It needs to be one. The hosted control is the one you have just created for notes. The action is “UpdateReplacementParameters”.
Tip: If you replicate the ability to attach notes in multiple entities you will re-use this same action for each.
Now create another action call that will create a note on the required entity. In this example contact. The hosted control this time is your global manager and action is CreateEntity. This time the order needs to be 2. The data portion contains the “code” needed to create the note.
LogicalName=annotation objected=EntityReference("contact",[[contact.Id]]) notetext=$Escaped([[Notes.Notes]$])
Obviously you change change “contact,[[contact.Id]]” to work with other entities. Such as “incident, [[incident.Id]]”.
Step Five – Create toolbar button
Now create a toolbar button on your navigation toolbar for the entity you want to update. Meaning in the contact navigation toolbar for this example. And add the two actions you’ve just created to the toolbar button. See example below.
The enable and visible conditions mean that the toolbar button will not be shown until the contact is exists. (If you are creating a new contact you can’t attach the notes until the contact has been saved.)
Leave a comment