ok, so I've got an interface which is a process start form for my process model.
In my interface I've got a gridfield in which I display a list of cases, and this gridfield is configured to allow me to select the ones that I want to assign to someone.
What I want to do is [having selected some of the cases with checkboxes] then populate a rule input with just those selected cases so I can then pass that into my process model for reassignment.
The gridfield looks like this:
label: "Cases", labelPosition: "ABOVE", totalCount: count( local!dbCases.data ), columns: { a!gridTextColumn( label: "Case Number", field: "caseId", data: index( local!dbCases.data, "caseId" ) ), a!gridTextColumn( label: "Case Project Name", field: "caseProjectName", data: index( local!dbCases.data, "caseProjectName" ) ), a!gridTextColumn( label: "Case Owner", field: "caseOwnerName", data: index( local!dbCases.data, "caseOwnerName" ) ) }, identifiers: local!dbCases.identifiers, value: local!dataGridSelection, saveInto: { local!dataGridSelection }, selection: true, validations: {}, shadeAlternateRows: true )
And the gridSelection looks like this:
local!dataGridSelection: a!gridSelection( selected: {}, pagingInfo: a!pagingInfo( startIndex: 1, batchSize: count( local!dbCases.data ), sort: a!sortInfo( field: "caseId", ascending: true ) ) )
The local!dbCases local variable is a the returned value of a a!queryEntity() call which pulls back my cases...
So - I *think* my local variable local!dataGridSelection will now have the selected items [but it's hard to tell without any kind of debugger tool (a source of substantial frustration)]
What I want to know though - is how do I get [only] the selected items into a rule input that I can then use in the rest of my process model?
Here's the code for my "assignment" button:
a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Transfer", saveInto: { a!forEach( /* <--- do I use some kind of forEach to loop through the grid selection, and how do I figure out which ones are selected? */ local!dataGridSelection, a!save( target: null, /* <----- what do I put here? */ value: a!gridSelection(local!dataGridSelection) /* <--- also, I'm pretty sure this isn't right */ ) ) }, style: "NORMAL" ) }, align: "START" )
Any help much appreciated.
thanks heaps,
David.
Discussion posts and replies are publicly visible
Hi davidb545
The below code will save the ids of selected rows from local to ri variable:
a!save( target: ri!RICasesToTransfer, value: local!dataGridSelection.selected )