159064 - no subject - How can I display cdt values in the SAIL

How can I display cdt values in the SAIL report which is querying a record? I am getting blank for Mod ID which is coming from a amendmentRequest_Info cdt. Below is my code:
load(
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 20,
sort: a!sortInfo(
field: "complianceComment",
ascending: true
)
),
with(
local!datasubset: queryrecord(
cons!PPLM_CUSIP_FEE_RECORD,
a!query(
selection: a!querySelection(columns: {

a!queryColumn(field: "amendmentRequest_Info.amendmentRequestID"),
a!queryColumn(field: "complianceComment"),
}),
pagingInfo: local!pagingInfo
)
),
a!gridField(
totalCount: local!datasubset.totalCount,
columns: {

a!gridTextColumn(
label: "Mod ID",
field: "amendmentRequest_Info.amendmentRequestID",
data: index(local!datasubset.data, "amendmentRequest_Info.amendmentRequestID", nu...

OriginalPostID-159064

  Discussion posts and replies are publicly visible

  • ...ll)
    ),
    a!gridTextColumn(
    label: "Comments from Compliance",
    field: "complianceComment",
    data: index(local!datasubset.data, "complianceComment", null)
    )
    },
    value: local!pagingInfo,
    saveInto: local!pagingInfo
    )
  • @zulfiqarp Hi, here are a few suggestions to you to resolve the issue:

    1. Is amendmentRequest_Info of type multiple? If so you may not be able access a list inside a list in the manner which you are trying to do. There are several posts in the forum which will help you to access a list inside a list if amendmentRequest_Info holds multiple values.

    2. Assuming that amendmentRequest_Info is not of type multiple, I would like to suggest to try below code:

    a!gridTextColumn(
    label: "Mod ID",
    field: "amendmentRequest_Info.amendmentRequestID",
    data: index(local!datasubset.data.amendmentRequest_Info, "amendmentRequestID", null)
    )

    Please do let me know if you have any questions. Further it would be good to let the forum users know the basic structure of cdt (atleast to a level of which you are making use of the fields) so that some one might quickly help you to resolve the issue.
  • amendementRequest_Info is of type multiple. Can you please provide links to posts that allow access a list?
    Thanks!
  • @zulfiqarp Sure, one thing I would like to suggest you to keep few things in mind as follows prior to implementation:

    1. You are querying a record of type present in PPLM_CUSIP_FEE_RECORD. So let's assume that you got 10 records as a result and you will be providing the same to grid component. As long as you use a primitive or custom data type (of type single) in the PPLM_CUSIP_FEE_RECORD there won't be any issue, as the one - one relation always gives the same count of records. As long as the count of the records the grid hold is same, it works fine.
    2. If the data type (primitive or custom) you are going to access is of type multiple inside PPLM_CUSIP_FEE_RECORD, there is a chance to get mismatch of the count of results between PPLM_CUSIP_FEE_RECORD (parent) and the amendmentRequest_Info (child) because amendmentRequest_Info maintains one - many relationship with the parent and this gives raise to an error. So here you should either build the grid based on amendmentRequest_Info or concat the multiple results of amendmentRequest_Info into a single value so that amendmentRequest_Info always maintain a one-one relationship with the parent.

    Here are the links to access a list inside the list.
    /search?q=OriginalPostID-103475
    /search?q=OriginalPostID-103475
  • 0
    Certified Lead Developer
    As far as I know you should be able to access the multiple property just fine; but unless you do some sort of text formatting it'll probably just cast itself to a flat semicolon-separated string.

    Also if I can suggest an unrelated tweak, you should replace your "null" calls with "{}" (empty set), which is handled better by the gridField when no data is returned.
  • @mschmitt Can you please provide me the function that can do text formatting to cast semi colon separated string?
  • 0
    Certified Lead Developer
    Does anything show currently? It depends on how exactly your data is coming back but I was hopeful that you might be able to utilize the joinarray() functionality across the array of amendmentRequestIDs in order to format it how you like.
  • @sikhivahans The links that you have provided do not address how to display cdt values with multiple type. Can you please provide me a SAIL code or link that can display nested cdt values on a report using a record as a source?
    Thanks!
  • @zulfiqarp Please try the attached snippet and do let me know if you have any issues. And for your information, the links I provided is just for accessing a list inside list, which you need to work on and develop an expression rule accordingly. Hope the attached snippet resolves your issue.
  • Thank you sikhivahs! The code that you provided only address one field. How can I display a cdt (multiple) on a report? For example, lets say I have cdt of multiple type dept in my process. Below is the data in the cdt. How do I display cdt value (multiple records) in my report?

    Dept ID Dept Name
    AB0001 Accounting
    AB0002 Finance
    AB0003 Marketing
    ....