Insert new line in AOWSIMPORT web service

Hello,

I'm trying, on Sage X3 V11, to import a Task using the specific X3 Model with the help of AOWSIMPORT WebService. The X3 Model for Tasks defines the field separator as a new line (\010\013), but as soon as I put a newline inside the I_FILE in the request body, I get the error "Bad input JSON parameters".

I also tried to change the field separator for the X3 Model, but the newline is the required value for a model with a clobs or blobs field.

Can anyone help?

  • 0

    Francesco,

    When using the AOWSIMPORT web service, one of the parameters for the web service is I_RECORDSEP.  Whatever you specify for this, you should use as the new line in the I_FILE.  So if you use "|" as the I_RECORDSEP, that is what should be at the end of each line of data in the I_FILE value.  Are you doing this?

    Denise

  • 0 in reply to Denise Hartman

    Here is my inputXml I tried:

    <![CDATA[{"GRP1": {"I_MODIMP": "YTSK","I_AOWSTA": "YES","I_EXEC": "REALTIME","I_RECORDSEP":"|","I_FILE": "TSK||SITE01|000004|||00001|XXX|20190131|20190130|XX|XXX|2|1|XX|1|2|HD4|~&c~38|Lorem ipsum dolor sit amet consectetur|HD6|~&c~23|Mia Mia Lorem Ipsum Descrizione|END"}}]]>

    I shouldn't use record separator, but the field separator, and since the field separator is a newline (\010\013, line feed and carriage return), this inputXml breaks the request and gives "bad input JSON parameters":

    <![CDATA[{"GRP1": {"I_MODIMP": "YTSK","I_AOWSTA": "YES","I_EXEC": "REALTIME","I_RECORDSEP":"|","I_FILE": "TSK

    SITE01
    000004


    00001
    XXX
    20190131
    20190130
    XX
    XXX
    2
    1
    XX
    1
    2
    HD4
    ~&c~38
    Lorem ipsum dolor sit amet consectetur
    HD6
    ~&c~23
    Mia Mia Lorem Ipsum Descrizione
    |END"}}]]>
  • 0 in reply to Francesco Perniola

    The record separator in I_RECORDSEP doesn't correspond to the record separator in your import template.  When calling the AOWSIMPORT, you have to designate what the record separator is in the I_RECORDSEP parameter.  If your field separator is "|", then you will need to use something else for your record separator, and append that to the end of each line in the I_FILE string.  

  • 0 in reply to Denise Hartman

    I don't have a problem with the record separator, but with FIELD separator. I can't change it and since its set to a newline, if i use a newline inside the inputXml it breaks the request. In summary:

    - Field Separator: "\010\013"
    - Record Separator: "|"
    - I_FILE: "TSK
    ...
    |HD4
    ...
    |HD6
    ... |END"

    Am i doing something wrong?