This process has been difficult, but I am almost at the finish line! I can nearly prove to myself that Kinetic can do what Classic can do!
I am stuck on a few last things:
Can’t filter a combo box by more than one property and show all the results it should. See: Post#51.
Can’t figure out how to properly delete records from my UD. In classic, I put a calculated check box field into the BAQ and set it to false. Then in my dashboard, I do this bit of custom code in a BPM:
// step through each row of results
foreach (var xRow in (from ttResults_Row in queryResultDataset.Results where ttResults_Row.Calculated_MyCheck == true select ttResults_Row))
{
using (Ice.Contracts.UD09SvcContract mySvc = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.UD09SvcContract>(Db))
{
mySvc.DeleteByID(xRow.UD09_Key1, xRow.UD09_Key2, xRow.UD09_Key3, xRow.UD09_Key4, xRow.UD09_Key5);
}
}
This custom action works in kinetic but keeps giving me the error from post #59.
It works in that the record is deleted, but the grid doesn’t update, and I get that error. I think I need to pass the checkbox value from the view UD_OpenJobInventory_0_0, to TransView, and somehow get my BPM to pick up the check box from TransView instead of directly from the query. Should I pass it through callcontext? What if I check the delete box on more than one record? How will the system uncheck my box and then move to the next check record?
In your grid, add your checkbox column to indicate which rows should be deleted.
Create an event triggered by your delete button / action.
In that event, add a dataview-condition widgit. These are the settings.
Then create the MyIterationEvent, and inside that event add your rest-erp delete by id.
The syntax for the key bindings looks like this.
Your main event will take all the rows matching the condition you set, then send each row ( using the on-the-fly view “matches” you specify ) to your iterative event.
Then refresh your BAQ at the end to remove the deleted rows.
You do not have to add matches as a dataview in the layer.
Did you do this by adding a field to your BAQ? Is there another way? I just tried by going to my grid > Data > Grid Model > Columns… Then I added a new column for the checkbox. This seems to have broken my grid. Now in preview mode, the grid does not populate any results.
In my case my BAQ already had a calculated selection column, so I used that.
On another form I used a UD table and one of the existing CheckBoxXX columns.
You should be able to add a column to the view in app studio only and make that work, but when I tried that it broke my grid too. I think it may be a bug with using BAQs in the grid ProviderModel and how it sends Select query parameters during execution.
Probably much easier to just make a BAQ calculated column.
Maybe not a bug, but when I have a grid setup with provider model bindings set it sends the column list in a select parameter to retrieve the data and errors because the added view column doesnt exist.
If you use the erp-baq wigit in an event it loads fine with adding columns to the view in app studio only.
Probably still better to use a BAQ calculated field if possible.
Good idea. Since I already had the calculated checkbox from my BAQ, I just used that instead.
I had my views set incorrectly. Now I get results, but still get that error on delete. In the debugger I can see that no key data was passed to the method. Did I do the ‘matches’ part wrong? Also my iterative event says no trigger… ?
Man, videos make it so much easier.
First, I would move the dataview clear and refresh events to your delete button click event from your iterative event, it will handle multiple rows much better, clear / refresh after processing all records first.
Second, my dataview condition example had a capital T for true, it should be lowercase.MyView.MyCol=true or just MyView.MyCol will work for the condition.
Third, your binding in the iterative event should be { matches.MyBAQColForKey1 }, not sure on your BAQ but it is probably UD09_Key1, UD09_Key2 etc. matches view is a direct copy of the BAQ view, the column names need to be the same.
The uBAQ that drives the whole thing is UD_OpenJobInventory (I know I put UD in my BAQ name… uggh). That BAQ points to UD09, so my criteria should be:
{ matches.UD09_Key1 } or { matches.UD_OpenJobInventory_Key1 }
Right?
It is whatever the Column Name in your BAQ is. Most likely { matches.UD09_Key1 }.
Open the dataview in App Studio, the column names are there. BAQ column name syntax is usually Table_Column.
I agree! The challenge is recording one small enough to post! I use ScreenToGif and it is really difficult to get the resulting GIF to come in under 1MB for posting here. Anyone have any tips? I use remove duplicate frames, and reduce the colors to 8. The error when I post says:
Sorry, that file is too big (maximum size is 100 MB). Why not upload your large file to a cloud sharing service, then paste the link?
Is 100MB just a typo? I can’t even upload a full single megabyte!
I think the delete part is working! Thank you @Joseph_Martin!
So, I want to check my data entry fields for nulls before I try to submit them to my table. The attached shows what I setup. I thought that if a condition was false it would display the dialog box then exit. I even added an exit event widget to the output of all the dialog boxes. The condition works to show me that I don’t have a part number, but then none of the other conditions get tested, and it seems to move right to executing my erp-baq widget. It even adds a blank row to my table! https://ibb.co/0hg5gVN
EDIT: I have since also tacked on the other Event widgets to the dialogs. I tried the event-cancel, event-complete, and event-next. None seem to stop the rest of the event from firing.
I got the conditions to work. But man, they are a pain! I can’t easily drag and reconnect the connector lines. Setting true/false outputs is really tricky. After I changed all my outputs and saved, I closed and reopened it, and they were all broken again, all the outputs of the dialogs pointed right to the next step in my event. Finally, after setting things over and over again, I went to the OnSuccess event for each dialog and added an event-cancel after each dialog on the false side of the conditions. This worked great.
I think the only thing left here is to get my dang Jobs combo box to list all the values in the dvJobLot dataview. I can see in the debugger that the dv has all four jobs that I expect to be listed when I choose a part and revision. However, the combo box only shows one of the four jobs. Seems to randomly show one of the jobs from the list, but never all of them. Is there some hidden option that forces a combo box to only display one value from its source? My revision combo box shows multiple revisions just fine.
I think it is the View Column Name under Reusable combo, try removing that.
I have a combo working the same way ( getting the combo data from a view populated in an event ), the only bindings I have set are the EpBinding for the combo, the View Name for the list dataview under reusable combo, and then the TextField and ValueField from the advanced section.
This Kinetic thing is going to drive me insane! I have it all setup and working. Saved, deployed, tested. Now I look back at myAddButton On_Click event. It used to have lots of dialog boxes that all end in a cancel-event. All those are still there, but the cancel-event is now getting linked to stuff I never linked it to!
Here is a before and after screen shot. The before shows what I expect it to stay saved as, since that was what it looked like when i saved it. the after is what it looks like after I reload the layer into application studio. Why are the event connectors so broken!?
Before (expected):
This is really weird. When I open my event, it looks all weird like this, and asks if I want to save when I close the event. As long as I don’t save the event, it still seems to function ok. Is it possible that the event is properly saved the way I wanted, but for some reason the connectors are rearranging themselves when I reopen the event?
I submitted a support ticket, but I don’t expect much since this is a customization. Still seems broken to me. At least my event is working properly even if I can’t open it and look at it without rearranging everything.
Yea, I have had that happen to me a bunch.
It opens the event, with nothing in it, and if you save it overwrites what was there with nothing.
Usually closing and restarting application studio fixes it for me.
It is definitely a bug with Application Studio, I was planning on reporting it myself at some point.
Here is an example where my condition won’t save changes I make on the true side. Instead, it plops all my widgets on the false side. At the end you see my try to close the event after saving it, but I can’t close the event tab. I have to close application studio completely to get back into my editable dashboard. Once I reload and look at the event again, it has reverted back to the same state it was in at the start of this video.