IT Process Automation

 View Only
  • 1.  missing ; before statement

    Posted Aug 16, 2013 11:09 AM
    Good morning,

    I am using the OOTB getFormRateItemValuesOp and have modified the Post
    execution code to have the following line:

    Process.FormValues = Process.FormValues+ " " Process.vmap.strKey+ ": " +
    Process.vmap.strValue + "\n";

    I've done this previously in Version 4.1 and have not had any issues.
    However, when I try to run it here, I get the following error:

    -- missing ; before statement (#31)

    I'll post the post-execution code below, but I can't seem to find where the
    issue is. Any help is greatly appreciated.
    Error in post-execution code. Failed to execute code:
    /*
    * Create an array of ValueMap objects that hold the form IDs/Values as a
    key/value pair
    *
    * Set a Process variable to hold this local array object to make the form
    IDs/Values accessible
    *
    */
    
    // declarations
    var  l_numFields = 0;
    var l_arrayFormIDsValues = new Array();
    
    if (Process[OpName].Result == 1) {
      Process.Successful__ = "TRUE";
    
     // get the number of form fields contained in the form
     l_numFields =
    Process[OpName].SoapResponseData.getFormRateItemValuesReturn[0].form[0].form.l
    ength;
     logEvent(0, "GetFormFieldsBySubsID", "Number of fields in form: " +
    l_numFields);
    
     /*
       for each form field, store the field ID and the field Value in a ValueMap
    object
       create an array of these ValueMap objects
     */
     for(var i = 0; i <l_numFields; i++) {
         vmap = newValueMap();
    
      vmap.strKey =
    Process[OpName].SoapResponseData.getFormRateItemValuesReturn[0].form[0].form[i
    ].ID[0].text_;
      vmap.strValue =
    Process[OpName].SoapResponseData.getFormRateItemValuesReturn[0].form[0].form[i
    ].value[0].text_;
    
      l_arrayFormIDsValues[i] = vmap;
      Process.FormValues = Process.FormValues+ " " Process.vmap.strKey+ ": " +
    Process.vmap.strValue + "\n";
     }
    
     // set a Process variable to hold the local array object to make the form
    IDs/Values accessible
     Process.arrayFormResults = l_arrayFormIDsValues;
     return;
    }
    else {
     logEvent(0, "ERROR",   "SOAP call getFormRateItemValues() failed");
     throw "SOAP call getFormRateItemValues() failed";
    }
     -- missing ; before statement (#31) 


  • 2.  RE: missing ; before statement

    Posted Aug 16, 2013 02:04 PM
    Basically, what I'm trying to do is pass all of the form fields into a variable to pass into the Description of a ticket. How I was doing it previously was through this piece of code:

    Process.FormValues = Process.FormValues+ " " Process.vmap.strKey+ ": " + Process.vmap.strValue + "\n";

    Is there a better way to achieve this?

    Thanks,

    Clinton


  • 3.  RE: missing ; before statement
    Best Answer

    Posted Jun 09, 2014 03:03 PM

    I'm sure you fixed this by now but I see you are missing a plus in your expression:

    Process.FormValues = Process.FormValues + " " + Process.vmap.strKey + ": " + Process.vmap.strValue + "\n";

     



  • 4.  RE: missing ; before statement

    Posted Jun 10, 2014 08:45 AM
    lindsay_estabrooks:

    I'm sure you fixed this by now but I see you are missing a plus in your expression:

    Process.FormValues = Process.FormValues + " " + Process.vmap.strKey + ": " + Process.vmap.strValue + "\n";

     


    Thank you Lindsay for following up on this. I do believe I corrected the issue and should've posted the answer here, but I'm glad you did so others can learn! Thanks again.