Data not loading or saving on customizations on native dashboard

Hello! I have been working on this for quite a while, and I am stumped. I was hoping for some guidance on the direction I should take to accomplish this task. I will use Non Conformance Dashboard as an example.

I am not VERY experienced as this is my first after college position, but I have a good understanding of SQL and data basics, and I also have been getting used to Epicor, Kinetic, App Studio, and all the fun they bring for a couple months. I’ve worked on multiple dashboards in app studio already, created some from scratch, but I haven’t worked much with editing a native dashboard.

Apologies for any confusion I may cause below, I can clarify if need be. But now to the issue.

I am adding fields to Non Conformance, on a separate custom page, called Quality. They must be populated when a Transaction ID is selected on NonConf’s landing page. On the Quality page, there is also a customized table, called Additional Parts. I have the below image’s structure as we have this working in Classic.

In Classic, multiple rows populate the additional parts table, as they all have the same Job Number. When a row is selected from the table, it populates the above fields with the newly selected row’s data over the initial data, which is the first listed row since the Transaction ID was selected. And whenever a change is made in those fields, and the native save button is pressed, everything needs to save. The data is stored in a UD table, UD08.

I started bringing in data using a BAQ that had UD08 as the only table within the BAQ. I got to a point where the data would load into the fields, but then came across errors when trying to select items within the table to change the rows, and nothing would EVER save. I played around with onClick_toolSave events and attempting to get the UD08 data to save, with no success. I further attempted connecting NonConf to UD08 in the BAQ to create a relationship between them, with no success.

I then decided to start over.

I looked into REST API. Calling Ice.BO.UD08Svc, using Update and GetByID and GetRows, only to continue to more errors. I have not been able to get any data to load into the fields like I did with the BAQ. I know GetByID needs Keys 1-5, and as I filled in required details, I would only ever get two errors - Record not found, and parameter key (1…2…3…) could not be found. I also tried using GetRows but still couldn’t get things to load.

So if I continue the REST route, would (the where clause) GetRows or (Key requiring) GetByID work better? and is there a way to find where the UD08 GetByID Keys are defined? (As in what the field behind them is? We have a sheet with what they should be, but it’s from a user who no longer works here and it is sloppy).

I tried using the debugger to find where to call the event to load UD08 data, (after the Transaction ID (Key1) is selected so it can go populate the UD08 fields), with no avail.

With regards to the data saving issue, I am pretty sure I need to use REST’s Update, and I wanted to add an event so UD08 can be saved using the native save tool. But I can’t edit the native event, so I should create my own Update event that triggers after the NonConf.Update event within onClick_toolSave?

In the end, I guess the best first question would be, would you recommend loading and then saving changes to the UD data with an updatable BAQ, reattempting to connect NonConf to UD08 in the BAQ, or continue to explore REST?

Any suggestions or thoughts are greatly appreciated. Thank you for taking the time to read the above.

You have a lot going on here.

In general, to answer your question from a high-level… it is okay to use a BAQ to PULL the data into the application. And then you can use REST to save changes to the data.

… but let’s start with getting your UD08 data to load.

You have a BAQ based on the UD08 columns you need (make sure you include all (5) keys).

I would then recommend creating a BAQ dataview.

Here’s an example where I have a BAQ Dataview and my BAQ only contains select columns from my UD02 table.

On my form, I have a grid. In that grid’s Grid Model, I have it tied to that dataview:

In the Provider Model section, I again call out the BAQ:

And in the BAQ Options, I have a where clause to filter my BAQ returned results:

When the grid is painted on the screen (and is expanded) it will automatically run the BAQ from the provider model, and the results will be stored in the Grid Model’s bound dataview.

Let’s get that set up first… so you can load your form and see your BAQ run and your grid is populated.

Yeah… I was doing well until my brain got overwhelmed with endless trial and error and started overthinking everything. Gonna have to get used to that in the IT world. I needed to step back and get a fresh view on where to start, thank you. Anyways…

Below is my BAQ Dataview set like yours, I have the keys and the required fields. Just to confirm, because I am going to use REST to save any updated data, I should have the fields that are going to change marked as updatable in the BAQ right?

I setup the grid and called the data view with the Ep Binding, set the BAQ in my provider model, then added the where clause.

And… Voila! I got the form to load in all the required data. I added the text boxes and others above the grid, and I’m assuming there is a way to connect the BAQ-retrieved data stored in the dataview bound to the grid model directly to those text boxes and drop downs that updates through an event whenever a row is selected and then saved through a REST service? Apologies for the run on sentence. :person_running:

I wouldn’t worry about making your BAQ updatable. When you’re ready to save, you can do that via save button/event and we can call the UD08.Update method at that point.

But first… now that you have your grid populating… what are you using the fields on the top of your form for? Are these just fields showing the same data from the grid?

Got it. So BAQ brings in the data, while REST will take care of saving/updating.

Those fields above the grid are going to show the same data as the selected row in the grid. It is the way we have it set up in classic. I didn’t really understand why at first, if you can just view, edit, and save the data in the rows in the grid, but I think they are there because of the drop downs.

There are 7 drop down fields, and you can change them in the rows, but whatever you put there does not show up in the dropdowns in the above fields. If you select the drop down and choose something, data will appear in both the field and the row.

Okay, so if they’re mirrors of each other… then you can bind those fields to the same dataview that is storing your BAQ results.

I don’t know what they all are… but your PartNum field could be bound to UD08.UD08_Key1, for example.

Just bind each of your fields to the corresponding UD08.Column you want.

Perfect. I connected the fields and now they change to whatever row is selected. Thank you!

Now, for the REST saving.

I would prefer to use the native save button for easier user use, but I understand if I cannot change much of the native aspect. Maybe I can refer to a native event that gets triggered after the save button is pressed to run a custom event to trigger UD08.Update?

My assumption, looking at the native save events, is that it runs a bunch of checks (conditions) on various columns of the NonConf dataview. NonConf.hasChanges === true, etc.

BUT… it may still work if you put your save event “after” that one. The native event should save changes to the NonConf record, and then you event will save the UD08 record.

If it doesn’t fire your event, we can retreat and create your own “Save” button for that page.

Either way, you need to create your own Save event.

Here is mine as an example:

I had my own save button. But first we’ll set your trigger to Event > After > OnClick_toolSave and see if yours fires as intended.

I have a condition to make sure any required fields are filled in by my user. You may or may not want something like this. Up to you.

Example condition expression: "{UD02_View.ShortChar02}" !="" && "{UD02_View.ShortChar03}" !="" && "{UD02_View.Key3}" !=""

I was making sure ShortChar02, 03, and Key3 were not blank/empty.

If false… I had an error message pop up to tell the user those fields were required.

If true… we do our kinetic-rest (rest-erp)… change yours to UD08, obviously:

Method Params:

Rest Services > Rest Args:

Click into Dataset >

That should be all you need.

I had a row-update where I was just changing a transview “saved” flag. you don’t need that.

I then had an event-next to refresh my BAQ (so my BAQ grid would re-run and my grid would show the updated results). Again… not sure if you need this in your scenario or not.

I was able to setup my save event exactly how you have it, with UD08 switched in. Tried triggering from after OnClick_toolSave and it did not work. I retreated, created my own save button with the same saving schema and still nothing saved.

When I had it trigger from OnClick_toolSave, I got no blue loading bar at the top. When triggered from the custom button, I do get that blue loading so it does something when my button is pressed. I think maybe the problem is lying within the rest-kinetic UD08.Update.

I skipped the condition and row update you have just for now, but I think keeping the grid refresh event is useful. I think I have it set right, I added the grid refresh from the toolbox, but could I see how your grid refresh event is set up?

You don’t have any response parameters under rest-kinetic right?

Just confirming, rest-erp and rest-kinetic should be the same thing, right? I see yours says rest-erp, I only see rest-kinetic, but it has the same logo as rest-erp.

No, no Response Parameters needed.

Yes, rest-erp and rest-kinetic are the same thing. They just changed names at some point.

My refreshBAQ event is just a bunch of erp-baq calls to update (5) different BAQs in my case.

What are you seeing on the screen with your Save event? You have data in your grid and fields… you change a value or two and click save. You see the little blue scrolly bar (so, its trying to do something)… then what happens? I’m assuming you leave the screen and come back and values revert back to what they were?

Are you acquainted with the debugging tools? That’s how we can watch and explore what is going on when your event fires.

I will say, I just reviewed my set-up and its not apples-to-apples with what you’re doing. So, we may need to add another couple things… but I want to see what your save event is doing in the debugger first.

For example, in the debugger, I can click my save button and see each step of my event fire and what values are being passed:

I have been following this as well as i have been trying to figure out how to do something similar as well. for me my BAQ as a bunch of other information in it as well as the UD01 info for updating. would this method work as well or would i have to do something different. and how does it get mapped to the right fields in the UD table to update?

I THINK it should…

… and I THINK this is the part I was referring to in my last post. Something I forgot :person_facepalming:

Give me a few minutes and I’ll write up that portion. :folded_hands:

Okay… I’m going to explain how my application is set up to give a little context.

On MY form, I have a BAQ grid (populated by a BAQ & dataview) as discussed above. So, I’m using a BAQ to query the database and DISPLAY the UD02 record(s).

Example:

My grid is set-up so the main reference column is a link. When I click one of those links it opens a slide-out panel where I can enter/edit information:

This is similar to the OP. The data being displayed here is UD02 data (in my case). I change the values here and click save and the UD02 record gets updated.

HOWEVER!!!..

What I skipped over is a crucial step.

When I click a specific link in that grid, I have a series of events that fire:

In the above event, (triggered by clicking my grid link)… I first call another event and this is the critical one:

Here I am performing a rest call and pulling a specific UD02 record into a DIFFERENT dataview.

A couple other things happen (a row-update to set a transview flag, which again, I don’t think is important) and then my slide-out panel opens.

What I just realized (after re-reviewing my customization) is that my fields on this form are NOT linked to my BAQ dataview… they’re linked to a UD02 dataview which I just populated via GetByID in the previous rest-call.

So, when I make changes to on my form, I’m not changing values in the BAQ dataview, I’m changing values in my UD02_View dataview.

When i click my “Save” button, the dataset I’m sending back to the server is from the UD02_View dataview.

Hope that all makes sense!

SOOoooo… let’s set a couple more things up!

~*~

First, create a new UDXX dataview (can just do this manually):

I called mine “UD02_View”. The Dataview name isn’t critical, but make sure the other settings are tied to your respective UD table:

~*~

Next, we need an event to populate the dataview.

No trigger. (We’ll call this from a different event)

rest-kinetic:

Method Parameters: (You need to add one for each of the (5) keys!)

You can ignore my Field Value of sysVariable.key1… this is a tactic that allowed me to use the same GetByID event across multiple BAQ grids.

Details if you're interested:

In my customization, I have (5) different BAQs pinging my UD02 tables which are populating (5) different grids. Clicking a link from any of the (5) grids would open up one of (5) different slide-out panels, but as shown above, before the slider opens I perform the GetByID rest call. Instead of building that rest-call in (5) different events, I just created it once.

Here’s the twist (in case you’re interested)… when you add an event-next action, you can pass parameters with it!

So,in the above event-next, yes, I am calling my getByID_UD02 event, but I’m also passing inputs with the call.

In this particular case, I’m passing the (5) UD02 key values from my BAQ dataview:

So when I run my GetByID rest call… those values are being held as:
sysVariable.key1
sysVariable.key2
sysVariable.key3
sysVariable.key4
sysVariable.key5

If I clicked a link from a different grid… I’m passing different values from a different BAQ dataview:

So, this allowed me to set up a single GetByID event… but the values being passed to it are all controlled based on the event-next action that calls it.

You Field Value would be: '{YourBAQDataview.UD08_Key1}'

For key2 your Field Value would be: '{YourBAQDataview.UD08_Key2}'

etc… fill out all (5) keys.

Kinetic Rest Arguments
Request Parameters: → NONE

Response Parameters:

The highlighted UD02_View is the name of the dataview I set up. So when this rest-call happens, the result will be returned to that dataview.

Exactly. When I was trying to use the native save, no blue scrolly, no anything. I leave, come back, data is reverted to what it was before I changed it.

When using custom save button, blue scrolly appears, but nothing else and data is not saved after leaving and returning.

Yes, this is the first case where I have had to use the debugging tool from my time working on Epicor but it’s understandable.

I did not check the debugger when I was attempting to fix saving, I will update with what I can see shortly. As well as what I can see after reading your previous post I did not see when writing this reply :upside_down_face:

Alright, I have added my UD08_View, connected it to the GetByID event with the parameters you gave, and set the trigger for GetByID to be after onClick_grdLandingPage. Currently, I am sitting at the following error: Record for update was not found by its SysRowID value [00000000-0000-0000-0000-000000000000].

I will continue troubleshooting.

Once your UD08 dataview and GetByID event are set up… you’ll need to do a couple more things.

One… you’ll need to re-map (sorry :person_facepalming:) your form’s fields to reference your UD08 dataview.

Two… we’ll need to create an event (or perhaps a couple) to populate your UD08 dataview (by calling you new GetByID event).

I’m assuming you’ll need (2) events for this:

  1. When your BAQ grid initially loads, it will automatically be on row(0). We need that to trigger your GetByID event to populate your UD08 dataview and therefor populate your remapped fields.

  2. When your user selects a different row in the BAQ grid, that GetByID will need to fire again to pull a different record.

#2 is easy… that’s just an event with a trigger of Dataview (your BAQ Dataview) > RowChanged

#1 is a little more tricky to figure out the trigger because your grid is populating as soon as the form loads and your grid is created. This is happening automatically because of how we set that all up. So there’s no clear event to run “after”. We may need to experiment and/or pivot if we can’t find a clean way to trigger that event.

Sorry, you’re working faster than I am! :rofl:

Remove the trigger from your GetByID event. We need to figure out when to trigger that.

Just did a quick test and I was able to get an event to trigger based on my BAQ DataView > RowChanged as soon as the grid loads… so… we may only need #2 in the above post.

Set that one up when you’re ready and we can see if that gets you your initial UD08_View loaded.

You’re suggesting to keep the original field EpBindings right? Rather than changing them to UD08_View.Key1…etc…just for this event testing, keeping them as BAQ populated UD08.UD08_Key1.

Theoretically, the BAQ fills in the field’s data, when a row is changed, GetByID should be triggered to hold the BAQ’s new, updated data in UD08_View, and then when UD08.Update gets triggered, UD08_View’s data will overwrite the data of what’s currently saved in the BAQ EpBinding fields? Almost like BAQ row changed (someone writing an update) > GetByID (gets triggered) > UD08_View (stores newly changed data) > save button (UD08.Update triggers) > UD08View values update the BAQ’s data.

I think that makes sense. Hopefully? :woozy_face:

I will now work on setting up an event that triggers getByID when I change a BAQ field.

No… and I’m sorry because it IS confusing and I’m probably not helping the matter.

Think of the BAQ Dataview & grid as just an easy way to query the UD08 table… just a window to see what’s there. The BAQ could return several rows of results depending on your query.

Your FIELDS should be bound to your UD08_View dataview.

When we select a row in your BAQ grid, your events will perform your UD08 GetByID rest-call and pull down a single record into your UD08_View dataview. That data will then populate your fields.

You can make changes to the fields. This will change the data in the local UD08_View dataview.

The Save button will push that UD08_View dataset (via update rest-call) to the server.

And that’s the crux of the UD08_View dataview… it is the one holding the UD08 dataset:

When we do that save, it will push the local dataset up to the server to update the Server dataset.

… We can then re-run the BAQ to verify and see the updated information.

~*~

So, quick and dirty summary:
Think of your BAQ grid as a means to read what’s on the server.

Selecting a row in the grid will use the “key” information from your BAQ Dataview and that particular record will be pulled into your UD02_View dataview.

We can make local changes to that record… then push it back to the server to write your changes.

Rerunning your BAQ then gives you an updated view on what’s on the server.