How can I use User Codes in a Combo box with SaaS licence?

I am making a form for a UD table, and I want to restrict certain text fields to a few choices. Clearly a drop down menu makes sense here - and it seemed that User Codes were the correct way to setup these limited choices. However, it seems like you need to be able to open the Extended Property Maintenance Form to tie your UD codes to a UD column. This window is not available to SaaS users.

What is the recommended work around?

You should only need a customization and use a combo tied to the UserCodes table. Then you set the EpiBinding to the field that will be used to store the value. There should be several examples of this floating around the forum.


While this does not exactly answer your question, I keep this handy for EpiCombos. This is a huge feature of Epicor.
To use User Codes, you don’t need EpiFilters or EpiFilterParams. You would enter something like this in the SearchFilter field:
CodeTypeID = "SIZE"
The EpiBOName is all you need to select and it should populate the rest of the properties for you.

2 Likes

I was following an example from this forum, this one to be specific. Do you have a better example for me to use?

I’ve tried doing that, here is what it looks like:

I get an error as soon as I click the drop down, and it says to download the error log from the server. I have the download server file tool open, and I see no log to download. Any ideas?

Perhaps I misunderstood, I thought your intention was to use UserCodes to define the selectable list. If so, your combo is wired up to the wrong datasource (you have it set to UD40, not UserCodes)

seems like there is some confusion on the topic here… the OP asked about UD tables… the discussion diverged into UserCodes (also called UDCode - making this an easy mistake)…
UDCodes are SUPER for Combo boxes… in fact if you define them first, and then in the extended table definition, you can link the field to the UserCode table… then when you add the combo box to the screen, it AUTOMAGICALLY puts things together for you.

To expand on what @Chris_Conn is saying, your Binding is correct, but the BO for the drop down you have set up for UD40.

Here’s an example where I have user codes set up.

private void BindBuyer()
{
try
{
string whereClouse =“Company =’”+ session.CompanyID +"’ AND InActive = False";
DataSet objds = csm.GetSearchRecords(“PurAgentAdapter”, “PurAgent”, whereClouse);
if(objds != null && objds.Tables.Count > 0 && objds.Tables[“PurAgent”].Rows.Count > 0)
{
this.ucmbBuyer.ValueMember = “BuyerID”;
this.ucmbBuyer.DataSource = objds.Tables[“PurAgent”];
this.ucmbBuyer.DisplayMember = “Name”;
string[] fields = new string[]
{
“Name”
};
this.ucmbBuyer.SetColumnFilter(fields);
}
else
{
this.ucmbBuyer.DataSource = null;
}
}
catch
{
}
}

You mentioned User Codes. This is UD40. Which one are you using? Also, Your binding is to UD40 as well. I doubt that is intended.

Jason Woods

Owner | Jason Woods Consulting

jason@jasonwoods.me | Cell: 360.903.4893

www.linkedin.com/in/jasoncwoods

http://jasonwoods.me

Here’s a more applicable example. UD100A table, Character01 binding. User code type “Call In”

Yes, I think you all are correct that I had the wrong properties set. I want to update the value in UD40, but I want the choices to come from the user codes.This is how I have it set now:

And as soon as I click the combo I get this error:

Can you show your epifilter settings? And I’m assuming you went into the User Defined Code Maintenance and made a list. (had to check).

image

You can’t have double quotes. Try singles. (see example above)

1 Like

-.- Seems like the error message could have said that.

Now I get “Cannot find column CodeDesc.” I tried CodeTypeDesc as well, got the same message “Cannot find column CodeTypeDesc”

Ah, I changed EpiDataSetMode to RowsDataSet instead of ListDataSet and now it works.

1 Like

It’s RowsDataSet not ListDataset (That’s IMportant)

Also the Table Name should be UDCode and the BO is incorrect

4 Likes

As simple as:

2 Likes

How about we go back to the original question of how to Enable the EpiMagic for User Code Combos when running under MT SaaS license?

The User Code Combo EpiMagic is accomplished via the Extended Property “UDCodeType”. When the Combo is bound to a Column that has the Extended Property set, it will automatically fill in the Combos Properties for the User Code BO and the Code defined in the Extend Property.

Easiest way to set this up:
Customization Mode, Customization
From Tools Menu Select “Wizards”, “Customization Wizards”, “Modify Extended Properties” - Launch that wizard
Select the DataView and Field for the UD Column where you want to store the User Code
Select the “Format” Extended Property
for Value - Enter the User Defined Code Type value in this case: Profiles
Finish the Wizard.
On the Main Customization Dialog go to the Script Editor Tab and in the code find the line added to set the ExtendedProperties for “Format”.
Change the word Format to UDCodeType
Your code should look something like:

     edvYourEpiView.dataView.Table.Columns["ShortChar01"].ExtendedProperties["UDCodeType"] = "Profiles";

Save Customization
Exit Form
Run Form - Select your customization. Now your Extended Property is “active”
Customize your form and add a Combo for your User Code.
When you bind it to the View and Column you defined in the Extended Property setup, the Combo will automatically configure as a User Codes Combo with “Profiles” as the Code Type.

8 Likes