How do I separate error messages with new lines?

samwallace881
Giga Expert

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.

7 REPLIES 7

Nana5
Mega Guru

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


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);


  }


   


    }


  }


    }


Hi Sam,


I think u should add the message in array field and after that u can split.



Thanks


How would I do that though, with the code I have above?