App Studio - DataView without database binding?

Hello all,

Can a DataView be created solely for the purpose of temporarily storing field values for other uses within a Kinetic form? I’ve tried creating one without binding it to a datasource (ICE, BAQ, etc) and then defining the columns I need, but any fields I bind to this become uneditable. Is there anyway to reference controls (and their values) from within the various value fields elsewhere in app studio? If that is possible, then these temporary dataviews would be less important.

The only success I’ve had with this is binding fields to the CallContextBpmData dataview. I’ve then been able to reference values from it elsewhere (like in dialog-show) by using the {CallContextBpmData.fieldname} syntax. This works, but it feels dirty; like I’m polluting something that’s intended to be used with method and data directives.

Documentation on these type of topics seems to be very sparse. I’ve read the courses on the Learning Center and looked through the App Studio documentation. Am I missing other resources?

Thanks!

Yes, you can create a dataview in your customization that is not referenced by a database table.

In the below video you can watch that I created one for an Epicor Function response.

Note that a dataview needs to get Initialized for it to be editable.

  • If you need a dataview that is not going to store objects but just temporary columns, TransView can be a good option (unless you want to perform an Update BO call)
  • The advantage of setting up additional columns in the dataview is that those columns will show up in Intellisense (autocomplete). Alternately, you can directly define those columns on Bindings… It will still work in runtime

https://epicor-my.sharepoint.com/:v:/p/ishkaran_talwar/EWpTDH26Ws9Nmocg2JInhwsBuy5v2f6vkeVR94PLeG9Flw?e=CWqX1S

3 Likes

I’m also interested in this, but I get a login screen trying to access the video link.

@Stephen_Booth Does this link work?
https://epicor-my.sharepoint.com/:v:/p/ishkaran_talwar/EWpTDH26Ws9Nmocg2JInhwsBvJJmvtTxTWzBneIZZHn0QQ?e=fGiPTP

1 Like

Perfectly, thanks

This was a great video, very helpful. I’m currently trying to do something similar with the rest-erp action an the DynamicQuery.ExecuteByID service method. I am successfully getting back my results:

{"returnObj":{"Results":[{"Part_PartNum":"BM56737","Part_PartDescription":"RAM PUMP FEEDER 702 034PUMP W/RH-CONTROLS","JobAsmbl_JobNum":"202443-21-1","JobAsmbl_AssemblySeq":0,"ParentJobAsmbl_PartNum":"BM56737","ParentAsmblPart_PartDescription":"RAM PUMP FEEDER 702 034PUMP W/RH-CONTROLS","Calculated_PartT...

but can’t seem to get them to load into a DataView and then into a corresponding grid. I’ve created a blank dataview and in the rest-erp action set the following options:



then on the grid, I’ve set the following:


with no other options.

I have no way of knowing whether the dataview is being populating since my developer console doesn’t show the additional application debug data (like in your video).

Any help would be appreciated! :slight_smile:

Press F12 to open Dev Tools, then click your application and press CTRL+ALT+8 to turn on debugging. Then press CTRL+ALT+V to look at the views.

2 Likes

Thanks for the tip! That gives me a lot more visibility. It seems that my dataview is not being populated from the rest-erp results. Is some other step necessary to initialize the data view? Or should a blank, custom data view be populated simply by specifying its name in the “View Name” fields of Rest Services/ERP Rest Arguments/Response Parameters (as in the screenshot above)?

If you’re just trying to display your BAQ in a grid, then you don’t really need a view. You can just set the BAQ ID in the provider model of the grid.

This is the only field I set on the Panel Grid.

Which then loads and creates a runtime view called erpView_0.

I would use the built-in BAQ functionality, but the BAQ has optional parameters that aren’t showing in the slide-out pane that appears (I have another Epiusers post about this). I don’t see any obvious way to control what and parameters and values get passed to the BAQ (like I can with raw API calls to the BAQ endpoint). Additionally, it would be nice to know how to stop the slide-out BAQ pane from appearing, if I want to use other UI elements to capture those values.

Regardless, it would be nice to know why this isn’t working since I might run into other use cases down the road.

1 Like

I would be willing to bet it’s a timing issue.
What event are you hooking into to for the REST call?

For reference, I hooked up your example to this and it worked fine:
image

I triggering this from a dialog-show which is in turn triggered by a button click:
image

Did you just drag those connectors together? If so, don’t do that; it’s broken. Stick to using the Behavior > OnSuccess (or other).

For example, I replicated your button, but I set it to “OnYes”, so when they clicked Yes in the dialog, it loaded the grid.
BAQView

Removing the dialog-show action altogether doesn’t make a difference. Connecting Button-Refresh onClick directly to rest-erp has no effect.

Okay, try this: preview your layer, open Dev Tools and press CTRL+ALT+8. Then click your button and go to the Network tab of Dev Tools. Do you see ExecuteByID in the list?
If so, click it and click the preview Tab. Do you see your query results there?

I really appreciate your help with this. Yes, the results are being returned. I recorded a quick screencast that shows how I have everything set up and the developer console results:App Studio rest-erp view issues

Few comments:

  1. You showed the dataviews in Dev Tools, the BAQ ran, then you looked at the old dataview data. The stuff that displays is static, so you have to press the hotkey again to pull new results.

  2. On the rest-erp > Rest Services > ERP Rest Args, the Parse From Response Path is not needed.

  3. After correcting the grid model binding from Custom_SubAssemblyStatus to SubAssemblies, did you recheck the views in Dev Tools? Based on your video, you have it currently bound to Custom_SubAssemblyStatus and I see a view called Custom_SubAssemblyStatus_0_0 which is usually created at runtime when a view doesn’t exist.
    image

  4. What version are you on? In some patch level of 2021.1 there was a bug where the Function widget would not write the view which is very similar to the issue you have. I wonder if it’s related?

  1. …so you have to press the hotkey again to pull new results.

Pressing again still shows an empty view.

  1. On the rest-erp > Rest Services > ERP Rest Args, the Parse From Response Path is not needed.

Good to know.

  1. …After correcting the grid model binding from Custom_SubAssemblyStatus to SubAssemblies, did you recheck the views in Dev Tools? … you have it currently bound to Custom_SubAssemblyStatus and I see a view called Custom_SubAssemblyStatus_0_0…

This layer has been added to a converted dashboard. The Custom_SubAssemblyStatus_0_0 data view is the one that was created during the conversion and can’t be removed. I’m ignoring it and creating my own for use with the rest-erp action.

  1. What version are you on? …

2021.2.3, the newest cloud version I believe

Got it working! :smiley:

Here’s what I think happened: I noticed two javascript errors in the console when testing that were complaining about missing event targets. When I first added this layer, I simply deleted the existing dashboard grid and added my own. This was because I couldn’t figure out how to get the grid to stop loading its BAQ. Binding it to the new view and removing the BAQ ID wasn’t working. Additionally, since events are no longer delete-able I ignored them.

This time around, I started from scratch on a new layer and hid the old grid and added a new one. I copied the configuration from the old rest-erp event action and this time it works.

This might just be a correlation but not causation thing, but it seems like those event errors were throwing a wrench in the rest of the works.

[edit]
Now the last piece of the puzzle is how to reference view data within the JSON payload of the rest-erp aciton. I’ve seen various question mark syntax around here.[/edit]