Hello Everyone,
I have to show the UI like this(read-only), first two columns' data comes from different table (like collateral_cdt) and 3rd and 4th columns data comes from (cust_doc_cdt).How can I display this Ui?
Please suggest on priority
Discussion posts and replies are publicly visible
You can restructure the list in a dictionary format using different CDTs and make the grid run on a local variable.
Can I get reference code Please?
Here I have used two different record having some relation between them. I believe in your case also the tables must have some relation with each others.You can have a rough idea from here, if that helps you.
a!localVariables( local!tickets: rule!PM_QR( recordType: 'recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets', filters: a!queryFilter( field: 'recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{2eb8bdc6-97a3-4a70-81ae-3fdbb1268306}projectId', operator: "=", value: 1 ) ), local!ticketAdditionaldetails: rule!PM_QR( recordType: 'recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details', filters: a!queryFilter( field: 'recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details.fields.{6cd53353-96fb-424f-afdf-34de7e66cbff}ticketId', operator: "IN", value: local!tickets['recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{df9c3dbf-550e-4d8f-a54e-8f2d372d3eee}id'] ) ), a!gridField( data: local!tickets, columns: { a!gridColumn( label: "Ticket Id", value: fv!row['recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{df9c3dbf-550e-4d8f-a54e-8f2d372d3eee}id'] ), a!gridColumn( label: "Title", value: fv!row['recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{6b0b4ddd-a48f-4b11-b1f5-be442dd9ac82}title'] ), a!gridColumn( label: "Story Points", value: index( local!ticketAdditionaldetails, wherecontains( fv!row['recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{df9c3dbf-550e-4d8f-a54e-8f2d372d3eee}id'], tointeger( local!ticketAdditionaldetails['recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details.fields.{6cd53353-96fb-424f-afdf-34de7e66cbff}ticketId'] ) ), {} )['recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details.fields.{0e12c3d6-ae60-4548-83b1-6b040b0cd93d}reporter'] ), a!gridColumn( label: "Status Id", value: index( local!ticketAdditionaldetails, wherecontains( fv!row['recordType!{5f0bd786-7684-4f3e-aff0-378836d403d9}PM Tickets.fields.{df9c3dbf-550e-4d8f-a54e-8f2d372d3eee}id'], tointeger( local!ticketAdditionaldetails['recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details.fields.{6cd53353-96fb-424f-afdf-34de7e66cbff}ticketId'] ) ), {} )['recordType!{ee57e7bb-821c-4d98-8707-82bcf2fe8216}PM Tickets Additional Details.fields.{e30c84f7-1c08-4684-9fa5-53233700a3a4}status'] ) } ))
yes thanks.
Hi Rishikesh Raj, I have some relation between two tables(Id from one table and sourceId from other table), Using I need to show download Icon for 2 columns. 
* For the first 2 columns, I will be showing the data by querying from another table. Help me on this code.
Thanks in advance.Please suggest on priority
a!localVariables( local!crAppCollateral_cdt: rule!CR_APP_QE_getAppCollateralForDocGeneration( cif_int: ri!cif_int, collateralFlag_int: 0, requestId_int: ri!requestId_int ), local!crCustDoc_cdt: rule!CR_CUST_QE_getCustomerDocDataBasedOnFilters( cif_int: ri!cif_int, requestId_int: ri!requestId_int, sourceRowId_int: index(local!crAppCollateral_cdt, "id_int", "") ), a!gridField( labelPosition: "ABOVE", data: local!crAppCollateral_cdt, columns: { a!gridColumn( label: " Type", value: index( fv!row, "collateralDescription_txt" ) ), a!gridColumn( label: " Type Detail", value: index( fv!row, "collateralTypeDescription_txt" ) ), a!gridColumn( label: "Conventional", ###here I need to show download icon### ), a!gridColumn( label: "Non Conventional", ###download icon here as well### ) } ) )
Tell me the exact purpose of using icon in these two columns. what will be the work of download icon here.
Or you just need to show download icon.
Its to download the documents, which is available for the type of tracker.
Is Document Id available in crCustDoc_cdt ?
yes it is available in the table.
Use the below code to display download icon, using wherecontains pass the document Id inside document.
a!gridColumn( label: "conventional", value: a!richTextDisplayField( value: a!richTextIcon( icon: "download", linkStyle: "STANDALONE", link: a!documentDownloadLink( document: 1 ) ) ) ),
a!localVariables( local!crAppCollateral_cdt: rule!CR_APP_QE_getAppCollateralForDocGeneration( cif_int: ri!cif_int, collateralFlag_int: 0, requestId_int: ri!requestId_int ), local!crCustDoc_cdt: rule!CR_CUST_QE_getCustomerDocDataBasedOnFilters( cif_int: ri!cif_int, requestId_int: ri!requestId_int, sourceRowId_int: index(local!crAppCollateral_cdt, "id_int", "") ), local!download: index( local!crAppCollateral_cdt, wherecontains( index(local!crAppCollateral_cdt, "id_int", ""), index( local!crCustDoc_cdt, "sourceRowId_int", "" ) ) ), local!docid: a!forEach( items: local!crAppCollateral_cdt, expression: index( local!crCustDoc_cdt, wherecontains(tointeger(index(fv!item,"id_int","")),tointeger(index(local!crCustDoc_cdt,"sourceRowId_int",{}))), "docId_int", "" ), ), a!gridField( labelPosition: "ABOVE", data: local!crAppCollateral_cdt, columns: { a!gridColumn( label: "Collateral Type", value: index(fv!row, "collateralDescription_txt") ), a!gridColumn( label: "Collateral Type Detail", value: index(fv!row, "collateralTypeDescription_txt") ), a!gridColumn( label: "conventional", value: a!linkField( label: if( isnull(index(fv!row, "docId_int", {})), "", document( documentId: tointeger( index( local!crCustDoc_cdt, wherecontains( index(fv!row, "id_int", ""), tointeger( index( local!crCustDoc_cdt, "sourceRowId_int", "" ) ) ), "docId_int", "" ), ), property: "name" ) ), links: a!documentDownloadLink( label: if( isnull(index(fv!row, "docId_int", {})), "", document( documentId: index(fv!row, "docId_int", {}), property: "name" ) ), document: index(fv!row, "docId_int", {}) ) ) ), } ) )
I am following this way to get lists of document from the crcustDoc_cdt and trying to map with crCollateral_cdt. But getting some errors. Could you please help me on this