******** Main Rule ********* load( local!KeyMap : rule!DP_Action_RetrieveAllSectionKeyMap(ri!KeyDept), local!SectionName : rule!DP_Action_RetrieveAllSections(index(local!KeyMap.data,"KeySection",{})), local!SectionName_cdt : todatasubset( a!applyComponents( function : rule!DP_Dashboard_SectionName( KeyMap : _, SectionName : local!SectionName.data ), array : if( local!KeyMap.totalCount = 0, {}, local!KeyMap.data ) ),topagingInfo(1,-1) ), local!SectionContent : rule!DP_Action_RetrieveAllContent(index(local!KeyMap,"KeyDeptSection",{})), with( a!formLayout( label : "", firstColumnContents:{ a!sectionLayout( firstColumnContents:{ if( local!KeyMap.totalCount = 0, {}, a!applyComponents( function : rule!DP_Dashboard_Grids( KeyMap : local!KeyMap.data, FormOrder : 1, SectionSubset : _ ), array: if( local!SectionName_cdt.totalCount = 0, {}, local!SectionName_cdt.data ) ) ) }, secondColumnContents:{ if( local!KeyMap.totalCount = 0, {}, a!applyComponents( function : rule!DP_Dashboard_Grids( KeyMap : local!KeyMap.data, FormOrder : 0, SectionSubset : _ ), array: if( local!SectionName_cdt.totalCount = 0, {}, local!SectionName_cdt.data ) ) ) } ) } ) ) ) ------------------------------------------------------------ ************** Grid LayOut Rule (DP_Dashboard_Grids)******************** load( local!KeyDeptSection : index(ri!KeyMap.KeyDeptSection, wherecontains(ri!SectionSubset.KeySection,ri!KeyMap.KeySection)), local!SectionContent: rule!DP_Action_RetrieveAllContent(KeyDeptSection : local!KeyDeptSection), local!FormOrder : if(mod(index(ri!KeyMap.FormOrder,wherecontains(ri!SectionSubset.KeySection,ri!KeyMap.KeySection)),2) = 1, 1, 0 ), with( if( local!FormOrder = ri!FormOrder, a!gridLayout( label : "", headerCells : {a!gridLayoutHeaderCell(label : ri!SectionSubset.SectionName)}, rows : a!applyComponents( function : rule!DP_Dashboard_GridRow( Subset : _ ), array : if( local!SectionContent.totalCount = 0, {}, local!SectionContent.data ) ) ), {a!paragraphField(readOnly : true)} ) ) ) ---------------------------------------------------------------------------------- *************** Grid Raw Rule (DP_Dashboard_GridRow) ******************* { if( cast(1,ri!Subset.KeyContentType) = 1, a!gridRowLayout( contents : { a!textField( value : ri!Subset.Content, readOnly : true() ) } ), {} ), if( cast(1,ri!Subset.KeyContentType) = 2, a!gridRowLayout( contents : { a!linkField( links : a!safeLink( label : ri!Subset.Title, uri : ri!Subset.Content ) ) } ), {} ), if( cast(1,ri!Subset.KeyContentType) = 3, a!gridRowLayout( contents : { a!linkField( links : a!documentDownloadLink( label : if( or( isnull(ri!Subset.Title), len(ri!Subset.Tile)=0 ), document(tointeger(ri!Subset.Content),"name"), ri!Subset.Title ), document : ri!Subset.Content ) ) } ), {} ) }