CA Service Management

 View Only
  • 1.  Var Break Line to Fill SDM Description

    Posted Jun 14, 2018 04:17 PM

    Hey guys,

     

    I have two fields in an offer and I need them to be concatenated and written in the SDM ticket description with some line breaks.

     

    I saw the question in the link https://communities.ca.com/thread/241784310-how-to-get-selections-from-a-selection-option-component-in-a-form but the "\n\n" code in my javascript does not put the line breaks in SDM description.

     

    Here's part of the code i'm using to concatenate the value of the fields.

     

    setDescription: function () {
    var zNecessidade = ca_fdGetTextFieldValue(ca_fd.formId, 'necessidade');
    var zJustificativa = ca_fdGetTextFieldValue(ca_fd.formId, 'justificativa');
    var zDescricao = 'Descrição da necessidade: \n\n' + zNecessidade + '\n\n' + 'Justificativa: \n\n' + zJustificativa + '\n\n' + 'CHAMADO ABERTO PELA CAU - CENTRAL DE ATENDIMENTO AO USUÁRIO';
    if (zNecessidade != '') {
    ca_fdSetTextFieldValue(ca_fd.formId, 'ca_sdm_attr_description', zDescricao);
    }
    }

     

    Did any of you ever have to do something like that?

     

    Many thanks!!



  • 2.  Re: Var Break Line to Fill SDM Description

    Posted Jun 19, 2018 09:58 AM

    Good Day.

     

    Enclosing a string in single quotes means to treat the string as a literal.  Do the actual \n\n characters appear in your output?  If so, change the variable syntax to use double quotes:

     

    var zDescricao = "Descrição da necessidade: \n\n" + zNecessidade + "\n\n" + "Justificativa: \n\n" + zJustificativa + "\n\n" + "CHAMADO ABERTO PELA CAU - CENTRAL DE ATENDIMENTO AO USUÁRIO";

     

    Regards,

     

    J.W.



  • 3.  Re: Var Break Line to Fill SDM Description

    Posted Jun 19, 2018 11:06 AM

    Hi J_W,

     

    First of all thank you very much for your help!

     

    I modified the variable as per your suggestion but for some reason it didn't work..

     

    When I change the variable to the double quotation marks the description is not saved in SDM.

     

    I tried changing some values, creating different vars for the descriptions but unfortunately also didn't work.

     

     



  • 4.  Re: Var Break Line to Fill SDM Description

    Broadcom Employee
    Posted Jun 19, 2018 02:49 PM

    Diego, throw something here for your consideration...you may give a try for

    

    instead of \n
    Thanks _Chi


  • 5.  Re: Var Break Line to Fill SDM Description

    Posted Jun 19, 2018 05:01 PM

    Hi Chi_Chen!

     

    Many thanks for your help too!

     

    Unfortunately the characters didn´t work, I tried to create a new variable only with these line break characters, but it also didn´t work, the description of the open call in SDM continues with the information in a single line.

     

    Anyway, thank you very much for the help.