Connecting Two Tables in Application Studio Events

Good Afternoon,

My company has recently upgraded from 10.2 to kinetic and I am trying to recreate some screen customizations with as little custom C# as possible.

I created a dropdown in POHeader (ShipTo Tab) that currently displays all the Warehouses in my company. Based on what the buyer selects I want the ShipTo Addresses to populate based on erp.Warehse.Address1 etc.

Does anyone know how to do this in an Application Studio Event? I have tried creating connections between tables POHeader and Warehse but to no avail.

Once you have the Warehouse selected, you can use the row-update widget in your event to set the address values in POHeader.
Something like:
image
add several columns to the same widget to cover each of the Address fields

Hi Jonathan,

Thanks for your answer, it makes sense that you could just put the datafield in the Expression box. But when I did this it just populates the field as “{Warehouse.Address1}”, literally. I am wondering wouldn’t there have to be a connection made somewhere so Epicor knows POHeader.CustomWarehouseDropdown = Warehse.WarehouseCode ?

don’t need the quotes

1 Like

Shouldn’t that still produce the desired value - just with quotes?

I feel like I only get that result when I spell something wrong (or capitalize incorrectly) … or when the data I’m trying to access doesn’t exist at the time the value is set.
Your data view is called Warehouse - and not Warehse?

oops, you may be right. I’m always "misquoting’!

1 Like

I think you need a dataview-filter-set component in your event. You can filter the target dataview (Warehse) and then set the filter: Warehse_WarehouseCode = ‘{EpiBindingOfDropDownList}’

(I’m assuming WarehouseCode is the value your combobox is delivering)

Then do the row-update to POHeader.

Sorry my mistake, I meant Warehse, in the code I put Warehse.

1 Like

Hi David,

Thank you for your response. I am still very new to Application Studio and using this wizard format. When I attempted to create the Dataview Filter it did not work. It will not even populate the Address at all anymore.
Does it have something to do with Warehse not being one of the options in the drop down when i start typing in the dataview field?

It looks like you have POHeader twice in your filter? Kinda tough to see.

But I’m not sure I follow. What is your combobox Epi.Binding? (Where it saves it’s value to)?

1 Like

sorry it looks like that because the field is POHeader.POHeaderWarehouse_c

1 Like

Yeah… why is it not there? Did you add Warehse as a DataView?

Wow I did not even realize you had to add tables to the dataview if they did not exist already.
I went ahead and added it and even attempted to make a parent child relationship with the Warehouse Codes since this is the only situation where I need information from Erp.Warehse.
I then removed the condition and went straight to the origional row update but now it returns the column as “undefined”

Think of it this way… in app studio, you’re not creating “tables”… you’re not even directly touching the database tables. You create DataViews that temporarily store data from a given table while you’re using the app. So, you’re not “adding tables to the DV”… you’re creating additional DV’s to reference other database tables. Pretty easy to remember… its a means of “viewing” the “data” from a database table.

I’ve never set up a parent/child relationship on my views. You’re not really “joining” the tables in any kind of relationship in App Studio. You’re just setting up DV’s to store information you can pull from later. I would suggest reading through some of the App Studio application help. There’s some good stuff in there on working with DV’s including the parent/child relationship. And again, I don’t think you need it, so I would get rid of that P/C relationship so it doesn’t cause any unforeseen issues.

Anyway… let’s take a step back and think through this… You now have a DV for Warehse to store the data from the Warehse table… but you also need an event to perform a rest call and pull the data into the view. Depending on the rest call parameters, you could pull one row/record into your DV, or many. For example a GetByID rest call will pull in one record based on a passed WarehouseID… but a GetRows call may pull in mulitple Warehouse records that belong to a given Site/Plant.

Are you familiar with using the debugger features in your browser? If not, search for posts on here that explain a bit more how to use it… but I’ll show some snips from a dashboard I’m building below to illustrate.

As you can see below, when I open up my form and look at my DV’s in the debugger, my Customer DV is empty…

Depending on how you add (added) your DV… if you did it manually, you’ll have to create the rest event. If you used the wizard, i think it may build a stock “GetBy” event for you. For example, I used the wizard to add my Customer DV. The Wizard also added the below “canned” event:

image

Notice this event does not have a trigger… but it is fully editable, so you can change the parameters within the rest call as required. For example, I edited the Method Parameters on this one to use my TransView.CustID field value.

image

I then created a search event:

data-clear - just clears out the searchResult DV of any previous research results.
search-show - this is where I call the OOTB Customer search
search-value-set - I assign the value of searchResult.CustID to TransView.CustID
event-next - THIS is where I do my customer rest call… and I can just drop in the event the wizard created for me earlier (with my tweaks).

Now, if I preview my form and perform my customer search… I can see data populated in my Customer DV:

So… you can have DV’s all day long… but you’ll need to create an event to populate that view.

5 Likes

Just to add here that GetRows will also pull some context data (in this case, WarehsePrinter and WarehseABC) - so I generally try to use GetList, since that returns a more-limited data set.
BUT the Warehse GetList method does not return address info, so you will want to use GetRows for multiple entries

1 Like

Thank you so much for such a detailed response David, this has really helped me get a better idea of how to use application studio.

I was able to get it to populate!

3 Likes

Awesome to hear you got it working! Happy to help.

2 Likes