# Creating a UD record using Rest

**URL:** <https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865>\
**Category:** Epicor ERP 10\
**Tags:** e10\
**Created:** [December 31, 2022, 10:58am UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865 "2022-12-31T10:58:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 10:58am UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/1 "2022-12-31T10:58:03Z")

</div>

Hi All,

Anyone able to create a ud record using rest?

Ive tried the GetANewUd, the general UD post and the other custom methods but cant seem to get it to work.

I dont want to build the logic inside the ubaq and let the api do it.

Any help would be great

Thanks  
Aaron

---

<div class="post-metadata">

**Author:** ![hmwillett](https://www.epiusers.help/user_avatar/www.epiusers.help/hmwillett/32/93207_2.png) [@hmwillett](https://www.epiusers.help/u/hmwillett)\
**Post date:** [December 31, 2022, 4:27pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/2 "2022-12-31T16:27:51Z")

</div>

> [@aarong](#):
>
> I dont want to build the logic inside the ubaq and let the api do it.

Don’t fully discount this. I use this method quite a bit because it’s easier to upgrade in the event that they change the REST signature. You’ll only be making a single REST call to your BAQ instead of multiple REST calls to create the record.  
Food for thought.

Otherwise, I just tested this out and it worked fine using the UD10Svc.Update call:

```auto
{
  "ds": {
    "UD10": [
      {
        "Company": "C001",
        "Key1": "Test1",
        "Key2": "Test2",
        "Key3": "",
        "Key4": "",
        "Key5": "",
        "Character01": "Meep",
        "SysRowID": "00000000-0000-0000-0000-000000000000",
        "RowMod": "A"
      }
    ],
    "UD10Attch": [],
    "ExtensionTables": []
  }
}

```

Note–RowMode being set to “A” is essential to make the add work.

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 8:31pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/3 "2022-12-31T20:31:08Z")

</div>

I’m getting this

```auto
Sorry! Something went wrong. Please contact your system administrator.

```

```auto
{
  "ds": {
    "UD02": [
      {
        "Company": "TEAGLE",
        "Key1": "4000",
        "Key2": "6000",
        "WebUserUID_c": "GDPR",
        "CreationDate_c": "2022-12-17:54:12.570Z",
        "Name_c": "GDPR",
        "Email_c":"GDPR",
        "Password_c": "GDPR",
        "Confirmed_c": false,
        "SysRowID": "00000000-0000-0000-0000-000000000000",
        "RowMod": "A"
      }
    ],
    "UD02Attch": [],
    "ExtensionTables": []
  }
}

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 8:35pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/4 "2022-12-31T20:35:58Z")

</div>

So I found the problem with the above error… It was my date.

Needs to be format `2022-12-31` now I’ve got another funny issue… I’ve just ran a BAQ on UD02 and no data is being returned but if I use Swagger… bam! Rows… WTF? 🤣

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 8:47pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/5 "2022-12-31T20:47:01Z")

</div>

Ignore me. I had a GetList custom code running hiding processed rows. -.-

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 8:50pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/6 "2022-12-31T20:50:04Z")

</div>

Thank you…  
All working 😃

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [December 31, 2022, 10:28pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/7 "2022-12-31T22:28:28Z")

</div>

[quote="aarong, post:5, topic:97865]  
Ignore me. I had a GetList custom code running hiding processed rows. -.-  
[/quote]

Don’t feel bad. I spent over an hour tracking down a very strange bug yesterday only to discover that I’m an idiot at the end. Not only that, I had reused the piece of code lower down, and was an idiot twice.

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [December 31, 2022, 10:32pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/8 "2022-12-31T22:32:30Z")

</div>

\*nothing to see here

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [December 31, 2022, 10:33pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/9 "2022-12-31T22:33:30Z")

</div>

I just love those…

I had one while back… setting a field using a bpm from false to true but automatically setting back to false after. I spent 2 days working that one out… rewrote code multiple times… 🤣

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [December 31, 2022, 10:34pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/10 "2022-12-31T22:34:18Z")

</div>

Luckily this time I only did a lot of /\* \*/ 🙂

---

<div class="post-metadata">

**Author:** ![John\_Mann](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mann/32/56849_2.png) [@John\_Mann](https://www.epiusers.help/u/John_Mann)\
**Post date:** [July 19, 2023, 1:58pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/11 "2023-07-19T13:58:25Z")

</div>

Good morning,

I’m trying to use the Rest API to call UD11Svc/Update and post this

```auto
{
  "ds": {
    "UD11": [
      {
        "Company": "T300",
        "Key1": "1689774713881",
        "Key2": "",
        "Key3": "",
        "Key4": "",
        "Key5": "",
        "Character01": [
          {
            "JobNum": "J049340",
            "AsmSeq": 0,
            "OprSeq": 20
          },
          {
            "JobNum": "J049341",
            "AsmSeq": 0,
            "OprSeq": 20
          }
        ],
        "SysRowID": "00000000-0000-0000-0000-000000000000",
        "RowMod": "A"
      }
    ],
    "UD11Attch": [],
    "ExtensionTables": []
  }

```

I am getting the “Sorry! Something went wrong. Please contact your system administrator.” error message. Does any of the JSON above look incorrect? What might be the issue I can look into?

---

<div class="post-metadata">

**Author:** ![hmwillett](https://www.epiusers.help/user_avatar/www.epiusers.help/hmwillett/32/93207_2.png) [@hmwillett](https://www.epiusers.help/u/hmwillett)\
**Post date:** [July 19, 2023, 1:59pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/12 "2023-07-19T13:59:25Z")

</div>

> [@John\_Mann](#):
>
> What might be the issue I can look into?

Check the Event Viewer on your server. It will tell you why it’s complaining.

---

<div class="post-metadata">

**Author:** ![aarong](https://www.epiusers.help/user_avatar/www.epiusers.help/aarong/32/101218_2.png) [@aarong](https://www.epiusers.help/u/aarong)\
**Post date:** [July 19, 2023, 2:16pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/13 "2023-07-19T14:16:26Z")

</div>

> [@hmwillett](#):
>
> Check the Event Viewer on your server.

![Pff Maeldan Benenuts GIF - Pff Maeldan Benenuts Sheldon - Discover & Share GIFs](https://media.tenor.com/kb8JvjWT24UAAAAC/pff-maeldan-benenuts.gif)

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [July 19, 2023, 2:49pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/14 "2023-07-19T14:49:47Z")

</div>

> [@John\_Mann](#):
>
> ```auto
> "Character01": [
> {
> "JobNum": "J049340",
> "AsmSeq": 0,
> "OprSeq": 20
> },
> {
> "JobNum": "J049341",
> "AsmSeq": 0,
> "OprSeq": 20
> }
> ],
> 
> ```

You’re trying to insert an object array into a string field.

Edit:  
If you are wanting to store Json in that field:

```js
{
	"ds": {
		"UD11": [{
			"Company": "T300",
			"Key1": "1689774713881",
			"Key2": "",
			"Key3": "",
			"Key4": "",
			"Key5": "",
			"Character01": "[{\"JobNum\": \"J049340\",\"AsmSeq\": 0,\"OprSeq\": 20},{\"JobNum\": \"J049341\",\"AsmSeq\": 0,\"OprSeq\": 20}]",
			"SysRowID": "00000000-0000-0000-0000-000000000000",
			"RowMod": "A"
		}],
		"UD11Attch": [],
		"ExtensionTables": []
	}
}

```

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [July 19, 2023, 3:47pm UTC](https://www.epiusers.help/t/creating-a-ud-record-using-rest/97865/15 "2023-07-19T15:47:44Z")

</div>

@skhan this will do what you were trying to do the other day. This was the post I was trying to find.
