Popup Special Handling Notes when OnChange of the Account field

Ian Hawkins
Tera Contributor

I have seen other people post this question and get some responses suggesting you can do this with a client script, but there is no further information on how to actually do it.
If we set a SHN on an Account, when someone creates a Case and selects that Account, the only time the SHN is displayed is when the Case is saved. We would like any SHN notes assigned to the Account to be displayed in the popup immediately after the Account is selected and not have to wait until the case is saved before we see it.
We have managed to display a popup and show one SHN when we select an account, but this only shows one SHN and does not have the standard SHN popup functionality, such as the Dismiss button, etc which we would like to use.
Is there any way to call the out-of-the-box SHN function that is run when the case is saved, when we change the Account field?
Thanks, Ian

7 REPLIES 7

Dhanakoddi2
Tera Contributor

Hi Woz,

Thanks for the solution. I have the same requirement. But I need to show the Special Handling Notes in CSM Configurable Workspace also.

Your requirement is working fine in Platform UI or Native UI, but not working in CSM Workspace. Could you please help me how to achieve this on CSM Workspace also?

I am also looking for this, did you find anything?

 

AzizaW
Tera Contributor

you need to use g_modal instead like this and pass the parameters of tableName and id in the url

g_modal.showFrame({
                    title: 'Special Handling Notes',
                    url: '/special_handling_notes_sv.do?' + 'tableName=customer_account' + '&id=' + newValue,
                    size: 'lg'
                });



and in the ui page you neeed to edit the place where tablename gets defined. for me it starts at line 11. 


Screenshot 2025-05-06 084637.png
this is what it looked like originally. and you cannot use expressions with g_modal

AzizaW_1-1746514202031.png

please note that this will make the ui page unusable for not workplace. so you might need to add a condition in your client script where you check if the url contains your workspace and use g_modal if it does and a the original solution with a different ui page or a copy of the ui page  .

so something like
var url = top.location.href;
if(url.indexOf('/now/cwf/' != -1){
 //here solution with g_modal and g_modal ui page
} else{
 //here solution with GlideModal and ui page that you didnt modify like i described in this post
}