Trigger multiple imports through My API

Comments

1 comment

  • Chris Coppenbarger
    Engaged
    Celigo University Level 1: Skilled

    The multiple imports section actually came from a use case I had, and had been working with Celigo on implementing. I am not trying to use it myself, but running into a snag. 

    1. The .length property doesn't seem to work, and so I changed it to .id for the variable I was trying to reference and that works. 

    if (customerImportRes.id) {
          //data.data.customer = customerImportRes.id;
          try {
            customerImportRes.data = data.data;
            customerImportRes.data.customer = customerImportRes.id;
            console.info("data", JSON.stringify(customerImportRes));
            // Running the second import
          caseImportRes = imports.run({ _id: 'xxxxxxxxx', data: customerImportRes });
            console.info("caseImportRes", caseImportRes);
            customerImportRes.id = null;
          } catch (err) {
            console.log(err);
            
          }     
          
      }

    2. I had to add my id to the initial data load for NetSuite in order to create the case.

    3. However, the second import appears to run three times, dropping data each run, causing it to fail. It does create a case the first time, but then errors out because of the second and third runs.

    0

Please sign in to leave a comment.