Call GetNew on UD table via REST

I am trying to setup a process where either a rest call adds a new record to a UD table or a new record is add via a form in Epicor. I would like to have the key1 field auto increment so i am thinking a BPM on GetNewUD02 is the way to go there. However I don’t see a Rest method for GetNewUD02 in the REST API thus my BPM will not be called.

Any suggestions on how to add a row to a UD table and auto increment the key1 field via REST and a form?

We are on 10.2.100.11

Cheers
Brett

You could use the custom method GetNewUd01 in rest to run that same method and run your bpm

1 Like

I didn’t know about the custom methods - thanks.

I am not sure what input parameters the call should have? I tried the example but that wasn’t happy.

Brett

Just pass in a blank DS it’ll “fill it” for you

umm, try as i may i cant seem to get right the blank dataset to feed into the method call.

I have tried below and all manner of variations :slight_smile:

{
“ds”: {}
}

Brett

No pass in the blank dataset formatted as shown in swagger

By swagger I assume you mean https://SERVER/APPSERVER/api/help/methods/Ice.BO.UD03Svc/index#!/Custom_methods/GetaNewUD03

In there i click on the example value and it copies it into the input.

When i try that i get a 500 error. I can see some error events on the server like so. Seems it is not liking the SysRowID on the extensionRow.

When i removed the extension table from the json it worked. Below input posted with response 200 OK :-):grinning: Once again thanks for the help.

{
“ds”: {
“UD03”: [
{
“Company”: “TMT”,
“Key1”: “string”,
“Key2”: “string”,
“Key3”: “string”,
“Key4”: “string”,
“Key5”: “string”,
“Character01”: “string”,
“Character02”: “string”,
“Character03”: “string”,
“Character04”: “string”,
“Character05”: “string”,
“Character06”: “string”,
“Character07”: “string”,
“Character08”: “string”,
“Character09”: “string”,
“Character10”: “string”,
“Number01”: “0”,
“Number02”: “0”,
“Number03”: “0”,
“Number04”: “0”,
“Number05”: “0”,
“Number06”: “0”,
“Number07”: “0”,
“Number08”: “0”,
“Number09”: “0”,
“Number10”: “0”,
“Number11”: “0”,
“Number12”: “0”,
“Number13”: “0”,
“Number14”: “0”,
“Number15”: “0”,
“Number16”: “0”,
“Number17”: “0”,
“Number18”: “0”,
“Number19”: “0”,
“Number20”: “0”,
“Date01”: “2018-08-31T02:51:34.056Z”,
“Date02”: “2018-08-31T02:51:34.056Z”,
“Date03”: “2018-08-31T02:51:34.056Z”,
“Date04”: “2018-08-31T02:51:34.056Z”,
“Date05”: “2018-08-31T02:51:34.056Z”,
“Date06”: “2018-08-31T02:51:34.056Z”,
“Date07”: “2018-08-31T02:51:34.056Z”,
“Date08”: “2018-08-31T02:51:34.056Z”,
“Date09”: “2018-08-31T02:51:34.056Z”,
“Date10”: “2018-08-31T02:51:34.056Z”,
“Date11”: “2018-08-31T02:51:34.056Z”,
“Date12”: “2018-08-31T02:51:34.056Z”,
“Date13”: “2018-08-31T02:51:34.056Z”,
“Date14”: “2018-08-31T02:51:34.056Z”,
“Date15”: “2018-08-31T02:51:34.056Z”,
“Date16”: “2018-08-31T02:51:34.056Z”,
“Date17”: “2018-08-31T02:51:34.056Z”,
“Date18”: “2018-08-31T02:51:34.056Z”,
“Date19”: “2018-08-31T02:51:34.056Z”,
“Date20”: “2018-08-31T02:51:34.056Z”,
“CheckBox01”: true,
“CheckBox02”: true,
“CheckBox03”: true,
“CheckBox04”: true,
“CheckBox05”: true,
“CheckBox06”: true,
“CheckBox07”: true,
“CheckBox08”: true,
“CheckBox09”: true,
“CheckBox10”: true,
“CheckBox11”: true,
“CheckBox12”: true,
“CheckBox13”: true,
“CheckBox14”: true,
“CheckBox15”: true,
“CheckBox16”: true,
“CheckBox17”: true,
“CheckBox18”: true,
“CheckBox19”: true,
“CheckBox20”: true,
“ShortChar01”: “string”,
“ShortChar02”: “string”,
“ShortChar03”: “string”,
“ShortChar04”: “string”,
“ShortChar05”: “string”,
“ShortChar06”: “string”,
“ShortChar07”: “string”,
“ShortChar08”: “string”,
“ShortChar09”: “string”,
“ShortChar10”: “string”,
“ShortChar11”: “string”,
“ShortChar12”: “string”,
“ShortChar13”: “string”,
“ShortChar14”: “string”,
“ShortChar15”: “string”,
“ShortChar16”: “string”,
“ShortChar17”: “string”,
“ShortChar18”: “string”,
“ShortChar19”: “string”,
“ShortChar20”: “string”,
“GlobalUD03”: true,
“GlobalLock”: true,
“SysRevID”: “0”,
“SysRowID”: “00000000-0000-0000-0000-000000000000”,
“BitFlag”: 0,
“RowMod”: “string”
}
],
“UD03Attch”: [
{
“Company”: “TMT”,
“Key1”: “string”,
“Key2”: “string”,
“Key3”: “string”,
“Key4”: “string”,
“Key5”: “string”,
“DrawingSeq”: 0,
“XFileRefNum”: 0,
“SysRevID”: “0”,
“SysRowID”: “00000000-0000-0000-0000-000000000000”,
“ForeignSysRowID”: “00000000-0000-0000-0000-000000000000”,
“DrawDesc”: “string”,
“FileName”: “string”,
“PDMDocID”: “string”,
“DocTypeID”: “string”,
“RowMod”: “string”
}
]

}
}

1 Like

Try passing this for the input.

{
  "ds": {
    "UD03": [
      {
        "Company": "100",
        "Key1": "string",
        "Key2": "string",
        "Key3": "string",
        "Key4": "string",
        "Key5": "string",
        "Character01": "string",
        "Character02": "string",
        "Character03": "string",
        "Character04": "string",
        "Character05": "string",
        "Character06": "string",
        "Character07": "string",
        "Character08": "string",
        "Character09": "string",
        "Character10": "string",
        "Number01": "0",
        "Number02": "0",
        "Number03": "0",
        "Number04": "0",
        "Number05": "0",
        "Number06": "0",
        "Number07": "0",
        "Number08": "0",
        "Number09": "0",
        "Number10": "0",
        "Number11": "0",
        "Number12": "0",
        "Number13": "0",
        "Number14": "0",
        "Number15": "0",
        "Number16": "0",
        "Number17": "0",
        "Number18": "0",
        "Number19": "0",
        "Number20": "0",
        "Date01": "2018-08-31T13:59:22.916Z",
        "Date02": "2018-08-31T13:59:22.916Z",
        "Date03": "2018-08-31T13:59:22.916Z",
        "Date04": "2018-08-31T13:59:22.916Z",
        "Date05": "2018-08-31T13:59:22.916Z",
        "Date06": "2018-08-31T13:59:22.916Z",
        "Date07": "2018-08-31T13:59:22.916Z",
        "Date08": "2018-08-31T13:59:22.916Z",
        "Date09": "2018-08-31T13:59:22.916Z",
        "Date10": "2018-08-31T13:59:22.916Z",
        "Date11": "2018-08-31T13:59:22.916Z",
        "Date12": "2018-08-31T13:59:22.916Z",
        "Date13": "2018-08-31T13:59:22.916Z",
        "Date14": "2018-08-31T13:59:22.916Z",
        "Date15": "2018-08-31T13:59:22.916Z",
        "Date16": "2018-08-31T13:59:22.916Z",
        "Date17": "2018-08-31T13:59:22.916Z",
        "Date18": "2018-08-31T13:59:22.916Z",
        "Date19": "2018-08-31T13:59:22.916Z",
        "Date20": "2018-08-31T13:59:22.917Z",
        "CheckBox01": true,
        "CheckBox02": true,
        "CheckBox03": true,
        "CheckBox04": true,
        "CheckBox05": true,
        "CheckBox06": true,
        "CheckBox07": true,
        "CheckBox08": true,
        "CheckBox09": true,
        "CheckBox10": true,
        "CheckBox11": true,
        "CheckBox12": true,
        "CheckBox13": true,
        "CheckBox14": true,
        "CheckBox15": true,
        "CheckBox16": true,
        "CheckBox17": true,
        "CheckBox18": true,
        "CheckBox19": true,
        "CheckBox20": true,
        "ShortChar01": "string",
        "ShortChar02": "string",
        "ShortChar03": "string",
        "ShortChar04": "string",
        "ShortChar05": "string",
        "ShortChar06": "string",
        "ShortChar07": "string",
        "ShortChar08": "string",
        "ShortChar09": "string",
        "ShortChar10": "string",
        "ShortChar11": "string",
        "ShortChar12": "string",
        "ShortChar13": "string",
        "ShortChar14": "string",
        "ShortChar15": "string",
        "ShortChar16": "string",
        "ShortChar17": "string",
        "ShortChar18": "string",
        "ShortChar19": "string",
        "ShortChar20": "string",
      }
    ]
  }
}

a little update…

I found that using the input suggested by Theodore didnt error out but it returned a dataset with 2 records, the one in the input and a new one - so that is not what i needed. I also noticed some error messages in the server event log suggesting the GetaNewUD03 should be used so i switched to that method and used below as the input. That returned a single new record that i could then edit and pass back in an update call.

{
“ds”: {
“UD02”: [],
“UD02Attch”: []
}
}

Cheers
Brett

My bad, thought you had indicated above that you were already calling the GetaNew method.