load( local!Active : true, local!data : { {ID : 1234567,PS : "Webwatcher Alert", Job : "Review Website Updates for Community Bancorp. (CMTV)",Task : "Approve Information",TaskAssignee : ""} }, local!data1 : { {ID : 1234567,PS : "Webwatcher Alert", Job : "Review Website Updates for Community Bancorp. (CMTV)",Task : "Approve Information",TaskOwner : "Tapan Shah",TaskOutcome : 1,Rating : 1} }, with( a!formLayout( label: if( local!Active, "Active Task Update Report", "Completed Task Update Report" ), firstColumnContents : { a!gridLayout( headerCells : { if( local!Active, { a!gridLayoutHeaderCell(label : "Job ID"), a!gridLayoutHeaderCell(label : "Process Stream"), a!gridLayoutHeaderCell(label : "Job"), a!gridLayoutHeaderCell(label : "Task"), a!gridLayoutHeaderCell(label : "Task Assignee") }, { a!gridLayoutHeaderCell(label : "Job ID"), a!gridLayoutHeaderCell(label : "Process Stream"), a!gridLayoutHeaderCell(label : "Job"), a!gridLayoutHeaderCell(label : "Task"), a!gridLayoutHeaderCell(label : "Task Owner"), a!gridLayoutHeaderCell(label : "Task Outcome"), a!gridLayoutHeaderCell(label : "Rating") } ) }, rows : if( local!Active, { a!applyComponents( function : rule!Utilities_TapanTest_ActiveTaskUpdate_GridRow( datasubset : local!data, index : _, subset : ri!subset ), array : if( or( isnull(local!data), len(local!data) < 1 ), {}, 1+enumerate(count(local!data)) ) ) }, { a!applyComponents( function : rule!Utilities_TapanTest_CompletedTaskUpdate_GridRow( datasubset : local!data1, index : _ ), array : if( or( isnull(local!data1), len(local!data1) < 1 ), {}, 1+enumerate(count(local!data1)) ) ) } ), selectable : true, selectionValue : ri!selectedIndex, selectionSaveInto : ri!selectedIndex ) }, buttons : a!buttonLayout( primaryButtons : { a!buttonWidgetSubmit( label : "Submit", style : "PRIMARY", Value : "Submit", saveInto : ri!submittedtext ), a!buttonWidgetSubmit( label : "Cancel", style : "DESTRUCTIVE", Value : "Cancel", saveInto : ri!submittedtext ) }, secondaryButtons : { a!buttonWidget( label : "Apply Changes To Multiple Jobs", Value : "Bulk Update", saveInto : ri!bulkupdate ) } ) ) ) ) Rule Input : 1) selectedIndex - type : Number(Integer) - Can store multiple values 2) submittedtext - type : Text 3) bulkupdate - type : Text 4) subset - type : Group - can store multiple values