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
Update: I've updated my a!save() method thus:
a!save( target: ri!RICasesToTransfer, value: a!gridSelection(local!dataGridSelection) )
However [while this compiles] I'm still not convinced that it's storing the selected items...
You can always assign the value of local!dataGridSelection to something you can see on the screen (e.g. the 'instructions' parameter of the a!gridLayout()) as a temporary way of debugging such "hidden" values...I do this all the time as part of an incremental development approach...just remember to remove it before you are done working on the component.
So, I've dropped this component onto my form [after the buttonArrayLayout]...
label: "Paging Grid", labelPosition: "ABOVE", totalCount: 0, columns: { a!gridTextColumn( label: "Text Column", data: {} ) }, value: a!pagingInfo(startIndex: 1, batchSize: 5), saveInto: {}, validations: {}, shadeAlternateRows: true )
I have no idea how to [now] assign it with the data in local!dataGridSelection (or ri!RICasesToTransfer) in such a way that it displays on screen [especially after I've clicked the button].... any thoughts?
thanks,
Hi David
A few questions to get us going:
S>
Hi Stewart,
We're using 19.1 at this time.
As to the reason for the need - that's not something I want to discuss on a public forum, but it is a business requirement to be able to transfer selected cases to specific people.
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 )