How do I separate error messages with new lines?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 08:18 AM
What I have done is on the Incident form, when you click on a certain account, the account note auto-fills in the notes section of the Incident form. If the customer has multiple lines of notes for their account, how do I make it so they show up on separate lines? because right now, they all show up on the same long line.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 08:33 AM
Hi Sam
I think in massages you need to add new line.
example:-
task.description ="Please disable the AD and email accounts for this employee." + "\n"+
"Please add an out-of-office message that the employee is no longer with ." + "\n"+ "Please add mail forwarding to go to".
Thanks,
Prakash Ranjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 08:40 AM
I tried to use the newline symbol but it didn't work.
I'm not actually typing the message into the script, it is grabbing the reference of it and then auto-populating the field.
Here is my code:
function onChange(control, oldValue, newValue, isLoading, isTemplate)
{
if(newValue == '')
{
g_form.hideFieldMsg('u_account');
return;
}
//local variables
var ciRec = g_form.getReference('u_account', getReferenceCallBack);
//local function as Callback for getReference() call
function getReferenceCallBack(ciRec)
{
if(ciRec)
{
if(ciRec.u_service_notes!='')
{
//here is where I am auto-populating the field
//but all the messages come together on one line instead of multiple.
var fieldMessage = ciRec.u_service_notes;
g_form.addErrorMessage(fieldMessage);
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 10:22 AM
Hi Sam,
I think u should add the message in array field and after that u can split.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2015 12:55 PM
How would I do that though, with the code I have above?