I have an updatable dashboard with a calculated field of type bit/logic so that a user can select rows to be updated by checking the calculated field.
What I am trying to do is take the weight field in the checked row and add it to a custom field in a tracker panel to keep a running total of the weight for all rows that are checked.
We have to ship full containers to a warehouse and containers can typically hold 40,000LBS of our product. I would like to show the user the total weight of what they have selected so far so that they can use it to make their next decision accordingly (along with other factors).
Since this is a prototype dashboard, a minimal viable product (MVP), I probably shouldn’t even be looking to add this feature, but I feel like it would be cool. For this reason I am wondering if anyone has any code so I don’t have to spend too much time on a custom feature for an MVP. If not, I’ll look to add it later- thanks for reading this
programmatically add the sum to the grid? That would be path of least resistance. More elegant solution with a field might a second filtered dataset where your checkbox is checked. Watch that for changes and loop sum your column. So long as you don’t loop the grid it shouldn’t take too long and hang up the screen or anything.
It sounds like you just want to update a field based on your checkbox. You will need a field to store that weight value, either in a UD table, or a UD field in an existing table. This should be doable. Setup your UBAQ to use advanced BPM updating only. You will need a custom action in your BAQ to trigger.
In your BPM code, insert a custom code widget to pull in the starting values for your variables. To select just your rows with checkboxes use something like this:
foreach (var row in (from ttResults_Row in queryResultDataset.Results where ttResults_Row.Calculated_UpdateRelease == true select ttResults_Row))
//or to get the total rows checked:
var ttResults_xRow = (from ttResults_Row in queryResultDataset.Results where ttResults_Row.Calculated_NewRelease == true select ttResults_Row);
totalrows = ttResults_xRow.Count();
I setup my BPM to loop through each checked row using condition widgets. As it loops, I use an Update Table by Query widget to add the field data I need.
In your dashboard customization code put in a button to trigger your BPM. The button code would be something like this:
I’m open to anything, but @jgiese.wci I was looking to add the weight value to a variable every time a row is marked as shipped. I don’t think another grid field would make a ton of sense to display the total weight of all checked rows.
What are you and @Vinaykamboj talking about with a filtered dataset? Do you have some posts on here or an example?
@NateS I am all set with the setup, I am using a custom advanced BAQ update that runs through the results and for each row where the checked checkbox is updated and true, it marks the pack shipped and links the pack to a BOL. Now I am just working on ancillary features of the dashboard like total weight.
Sure i mentioned the same that you could just use the summing of the grid, but my impression is that is not what @utaylor was looking for.
Not a grid field it’s a tracker field i’m talking about. You could either add another grid panel filtered down to just checked true you could loop that dataview to get your sum of weights and hide the grid, or create the filtered dataview in custom code and sum the values from that. It just gives you something to hing off. I wouldn’t use any grid events or you’re asking for performance issues. Whatever you do, do it in the dataviews not the UI.