# UD Table from UD Method Method

**URL:** <https://www.epiusers.help/t/ud-table-from-ud-method-method/61598>\
**Category:** Epicor ERP 10\
**Tags:** e10\
**Created:** [November 6, 2019, 9:46pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598 "2019-11-06T21:46:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdewitt6029](https://www.epiusers.help/user_avatar/www.epiusers.help/jdewitt6029/32/10215_2.png) [@jdewitt6029](https://www.epiusers.help/u/jdewitt6029)\
**Post date:** [November 6, 2019, 9:46pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/1 "2019-11-06T21:46:44Z")

</div>

I have a simple question. I have a UD Method that I am using in a configurator. I need to query a UD table to get a value but I can’t seem to get the namespace right. I have this:

```
var xyz= (from x in Db.UD14
				where x.DtRipPerStick == "11"
				select x).FirstOrDefault();

```

It doesn’t like Db. or Erp. or Ice. What am i missing to query a UD table?

---

<div class="post-metadata">

**Author:** ![Aaron\_Moreng](https://www.epiusers.help/user_avatar/www.epiusers.help/aaron_moreng/32/745_2.png) [@Aaron\_Moreng](https://www.epiusers.help/u/Aaron_Moreng)\
**Post date:** [November 6, 2019, 10:01pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/2 "2019-11-06T22:01:00Z")

</div>

If it’s an extended field on that table (I think it is), you’ll need to reference it in one a few ways.  
You could try `x.UDField<string>("DtRipPerStick") == "11";`  
or `x["DtRipPerStick"] == "11"`

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [November 7, 2019, 12:12am UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/3 "2019-11-07T00:12:38Z")

</div>

This will work the way you have it written, assuming this is a server method and that the column name is correct (missing \_c possibly?)

---

<div class="post-metadata">

**Author:** ![jdewitt6029](https://www.epiusers.help/user_avatar/www.epiusers.help/jdewitt6029/32/10215_2.png) [@jdewitt6029](https://www.epiusers.help/u/jdewitt6029)\
**Post date:** [November 7, 2019, 1:31am UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/4 "2019-11-07T01:31:55Z")

</div>

The columns are not the problem. I cant seem to reference the table. Tells me there is no UD14 (or any UD table) in Db. Namespace.

BPM no problem. No UD method I cant get it to work.

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [November 7, 2019, 1:42am UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/5 "2019-11-07T01:42:14Z")

</div>

Can you post a screen shot of your method - like this shown below? This accesses UD14 and a UD column just fine (using same code). I was always under the impression \_c was required on UD column names when creating but sounds like you may have an issue before that. Can you post the error as well?

 ![image](https://epiusers.help/uploads/default/original/3X/d/5/d5298e3edda03da015430882f7f6c18b91bc0c85.png)

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [November 7, 2019, 4:12am UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/6 "2019-11-07T04:12:23Z")

</div>

One other thing that I thought of is that sometimes errors you see in UD methods might not be directly related to the code you are checking the syntax for. It could be that another method has an error or in the calling of a different method.

---

<div class="post-metadata">

**Author:** ![jdewitt6029](https://www.epiusers.help/user_avatar/www.epiusers.help/jdewitt6029/32/10215_2.png) [@jdewitt6029](https://www.epiusers.help/u/jdewitt6029)\
**Post date:** [November 7, 2019, 3:06pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/7 "2019-11-07T15:06:54Z")

</div>

It looks like the table is different than the rest of the tables. If i use Linqpad i see this:

![Annotation%202019-11-07%20095850](https://epiusers.help/uploads/default/original/3X/d/5/d537e90c27bac7c5f62866e6b98a9c39e7b0c59a.jpeg)

But i can’t seem to reference that table. I have this:  
`var row = Db.UD14_UD.Where(u => u.DtRipPerStick_c == 11).FirstOrDefault();`

I get this error:  
 ![Annotation%202019-11-07%20095850b](https://epiusers.help/uploads/default/original/3X/1/f/1f3c42727bdbccb8c16e64886b9c7461e0f2d1e6.jpeg)

I get the same message if i try  
`var row = Db.UD14_UDs.Where(u => u.DtRipPerStick_c == 11).FirstOrDefault();`

I don’t get that same error if i do this but i get a different error saying it can’t find DtRipPerStick\_c:

`var row = Db.UD14.Where(u => u.DtRipPerStick_c == 11).FirstOrDefault();`

![image](https://epiusers.help/uploads/default/original/3X/f/3/f3f69cd9be413a879d704afb4fba33fa8749e5fc.png)

---

<div class="post-metadata">

**Author:** ![Aaron\_Moreng](https://www.epiusers.help/user_avatar/www.epiusers.help/aaron_moreng/32/745_2.png) [@Aaron\_Moreng](https://www.epiusers.help/u/Aaron_Moreng)\
**Post date:** [November 7, 2019, 3:20pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/8 "2019-11-07T15:20:49Z")

</div>

Are you able to type “x.” And then hit ctrl+space bar to see what fields and method are available on your Db.UD14 query? Assuming you’re using query syntax

Even backing up a step, do the same with Db to see what it can see

---

<div class="post-metadata">

**Author:** ![jdewitt6029](https://www.epiusers.help/user_avatar/www.epiusers.help/jdewitt6029/32/10215_2.png) [@jdewitt6029](https://www.epiusers.help/u/jdewitt6029)\
**Post date:** [November 7, 2019, 3:34pm UTC](https://www.epiusers.help/t/ud-table-from-ud-method-method/61598/9 "2019-11-07T15:34:01Z")

</div>

To answer your question, nothing shows.

> [@Aaron\_Moreng](#):
>
> Are you able to type “x.” And then hit ctrl+space bar to see what fields and method are available on your Db.UD14 query? Assuming you’re using query syntax

I can’t say i understand how Epicor creates tables and joins them together. I don’t understand why I have a UD14\_UD table and no UD14 table or why the UD14\_UD table has a foreign key to Ice.UD14.  
Irregardless I have found the issue with what i was doing. When I run the queries in LinqPad, it shows the columns like this.

![image](https://www.epiusers.help/uploads/default/original/3X/a/6/a6d1fca8153f773998a1ce3db035146d1d37e9d5.png)

Then i queried in SSMS and saw a difference.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/f/e/fe32e4915c7f047c694d64a94a063ae4d12cea0f.png)

I was using a capital ‘D’ because that is what i was seeing in LinqPad. I changed it to lowercase and all is well in the world.

```
var row = Db.UD14.Where(u => u.Key1 == "Default").FirstOrDefault();
return Convert.ToString(row.dtRipPerStick_c);

```
