Is it possible to use multiple datasubsets inside a SAIL grid. I have a gridFiel

Is it possible to use multiple datasubsets inside a SAIL grid. I have a gridField that is currently using two datasubsets to display data but only values from one datasubset is getting populated right now. Following is my code of two datasubsets which are called milestone_datasubset and psa_datasubset:
load(

local!start,
local!end,
local!gridSelection: a!gridSelection
(
pagingInfo:a!pagingInfo
(
startIndex:1,
batchSize:10
                    )
          ),
local!list: if(rule!COMMON_IsNullOrEmpty(ri!start), null, if(rule!COMMON_IsNullOrEmpty(ri!end), null, rule!PSA_PSAAssignmentsPSACountBtwTimeFrame(cons!PSA_MILESTONE_TYPES[1],ri!start,ri!end))),


local!psa: if(rule!COMMON_IsNullOrEmpty(local!list.PSA_ID), {}, apply(rule!DCMIFS_getPSAByPSAId,local!list.PSA_ID)),



with(
{

local!milestone_datasubset:todatasubset(local!list, local!gridSelection.pagingInfo),
local!psa_datasubset:todatasubset(local!psa, local!gridSelection.pagingInfo),
}
)
)



And my gridField lo...

OriginalPostID-106601

OriginalPostID-106601

  Discussion posts and replies are publicly visible

  • ...oks like this:

    a!gridField(
                                                                label:"Table",
                                                                instructions:"",
                                                                totalCount:length(local!list.PSA_ID),                     
                                                                selection: false,

                                                                columns:{
                                                                a!gridTextColumn(label:"PSA Number",
                                                                                              field:"psaNumber",
                                                                                              data:{index(local!psa_datasubset.data, "psaNumber", {})},
                                                                                              alignment:"LEFT"),
                                                                                              a!gridTextColumn(label:"Assigned to Office Date",
                                                                                              field:"Milestone_Date",
                                                                                              data:{index(local!milestone_datasubset.data, "Milestone_Date", {})},
                                                                                              alignment:"LEFT"),
                                                                                              
                                                                a!gridTextColumn(label:"MM-YYYY",
                                                                field:"Milestone_Date",
    data:{datetext(index(local!milestone_datasubset.data, "Milestone_Date", {}), "MM/yyyy") },
    alignment:"LEFT"),
                                                                                              
                                                                                              
                                                                                              
                                                                                    
                                                                                              a!gridTextColumn(label:"Office",
                                                                                              field:"primaryTechnicalOffice",
                                                                                              data:{index(local!psa_datasubset.data, "primaryTechnicalOffice", {})},
                                                                                              alignment:"LEFT")
                                                                                              },
                                                                                              value:local!gri...
  • ...dSelection,
                                                                                              readOnly:true,
                                                                                              saveInto:{local!gridSelection}
    )
  • How about you use one grid per data subset; this will allow the information to be presented in a clearer way. If it is needed for both data subsets to be presented in one grid and if the data subsets are Entity Backed, then you could also consider creating a view in your DB Server to merge the tables from where the information is obtained and return it as only one data subset.
  • Two datasubsets will not work if paging is enabled. Since they don't have the same fields it would break. If you managed to make two pagingInfos, the rows would not sort together.

    A quick way to do this would be to make a rule to construct an ad-hoc datatype (or make another CDT the normal way),
    rule!gridFiller(
    {
    psaNumber:ri!psaNumber,
    milestoneDate:ri!milestoneDate,
    etc
    }
    )

    Then in your Report populate this "ad hoc" data structure like below. Put the result in a datasubset.
    apply(rule!gridFiller(_,_),merge(psa.psaNumber,list.milestoneDate)
  • Thanks Jesse and Ricardo.....I implemented two datasubsets by combining them into a view...