Basic help needed saving data on dashboard

Hello, I am trying to create a dashboard some basic functionality. It is for Projects and in the top grid I have active projects listed, and the bottom panel displays an editable text area of the project comments. I am trying to get it to save the comments. I have a save button but I don’t know what method to call to save them.

I was able to get the comments for each project by using events in the grid. I use a GridRowSelected event to call dvProjectComments_Get which does a ‘erp-baq’ method using a parameter (project ID) to get the project comments and loads the dataview ‘dvProjectComments’

So this all works great but how do I save the comments? I can’t find any help on this either!

Thanks

You’ll either need to use an Updateable BAQ and send your changes through that, or call the Project business object’s Update method using the rest-erp widget. The App Studio guides have examples.

The BAQ is updateable. And I was having trouble finding examples. I think I have looked through all of the help I could find.

You use the same baq widget, change the mode to update.

1 Like

OK I think I have that done. The btnSaveComments_onClick event calls ‘kinetic-baq’, with the BAQ and view and mode set:

And the BAQ update options:

So in debugging, I can see that the dataview has the edits that I did:

But then after I click the Save button, the dataview is still the same..

? Any ideas? :neutral_face:

What does the network trace show for the execute baq payload.

1 Like

I think this is what you are looking for:

If not, let me know.

Thanks

Right so expand that dataset all the way out. Is your row mod of U in there?
What is the response?

3 Likes

I have had to add a row update to change the dataview.RowMod to “U” before using the kinetic BAQ widget before.

2 Likes

No, the RowMod is null:

Yeah so I have tried to report this to support a bunch of times. I have gotten various answers including, we can’t reproduce it, as well as, the row mod doesn’t need to be U it will update anyway (?!???).

Some work arounds are to put a custom directive in your ubaq to set the row mod to U. Or write your own function to do the update. Or start over and use the wizard. The wizard uses rest services instead of the baq widget and seems to work a little bit better (although it still doesn’t work in a lot of cases, especially for multi-row updates).

3 Likes

Yeah, that’d be the problem. It needs to be “U” to tell the system to do the update. @aosemwengie1 already gave you the workarounds.

1 Like

I think this worked!

It saves the comments!

Thanks all :slightly_smiling_face:

5 Likes