Sorting grid data column populated using 2nd CDT.

Hello,

           I can populate and display a column from a 2nd CDT for a report Grid. But the moment I press the sorting on any other columns the 2nd CDT column data doesn't match up. Also, i'm querying the 2nd cdt column using a different cdt with all the columns (the 1st CDT has limited columns to support Report grid). When the grid freshly loads, everything seems to be working fine and paging info is correct is well for all the multiple data. But the sorting of any columns breaks the 2nd CDT column data. Also pressing again this same column, realigns everything perfectly.

 

            Has anyone tried displaying data in grid where data could've same primary keys, querying on different columns and yet sorting wouldn't be an issue. (note: sort field is the same in both cases, 2nd column data is derived using the same common column)

 

 

 

-

Thanks,

Nick

  Discussion posts and replies are publicly visible

  • Hello Nick,

    I would suggest you to put the code in the post so we can help you better. and I am not 100% sure what you are actually doing, or what you mean when saying "using a second CDT"?

    If you need to populate information of multiple tables i would encourage you to use a view in the database and create a CDT which can contain both tables, and query the information and you don't have to complicate your self.

    Let me ask you some questions do you have a with and local variables which populate your grid, if so maybe that is your problem and the way to solve those sorting pagination problems you have to do the following, in the grid in the saveInto, query again the database with the new paginInfo (save!value or you variable) that way what you show will match during the pagination , if you have filters ad a button to explicitly do the search, and maybe the with you don't need it any more.

    Finally, Please post your code in case nothing of this helped.

    Jose Perez
  • Hey Josep, I've two interfaces (one for a report display, the second child interface containing the display grid). 

     

    I'm trying to the display the priority column in the report that uses the 2nd cdt PMCRecord

    load( /* first interface */ local!allpmcs: append( local!pmc, local!carryOvers ), /* first interface code ends here */ local!pmcDataSubset: todatasubset( local!allpmcs, local!pagingInfo ), local!dat: local!pmcDataSubset.data.pmcID, local!getdata: local!pmcDataSubset.data, local!pmcRecord: if(rule!APN_isEmpty(local!getdata), {}, rule!OTGNXT_getpmcRecordVWBypmcIds(local!getdata.pmcID) ), local!pmcRecordDataSubset:todatasubset( local!pmcRecord ),

     

    /* local!all : merge( local!pmcDataSubset.data, local!pmcRecordDataSubset.data), local!all2: todatasubset( local!all ), local!all3: index(local!all2,"priority",{}), local!all2.data ) */