How to make record for array inside a CDT ?

Dears,

I have a CDT which contains array of another CDT which also contains another CDT (3 levels)

So I have "Applicant" which contains list of "AppliedJobs" in which each element in "AppliedJobs" contains reference to two CDTs "Employer" & "JobPost"

And I want to make a record to display all "AppliedJobs" for a given applicant ID.

But unfortunately, I cannot find a way in records to select array field inside the "Applicant", so any ideas how to make it ???

  

  • Hi 
    You need to see if the data type is same of the field and the record field, if both are same you can define using like this.

  • If the field type and component type matches. That filed can be mapped and the value will appear. As per the best practices nested cdt must be avoided if it exceeding more than one level. Try to use different tables and make use of the database view concept.

  • In general I think the best implementation for this use case would be to have the Applied Jobs be listed on the Record Dashboard for an individual Applicant, since presumably the list of Applied Jobs could get rather long for certain individuals.

  • Thanks for all,

    I had to use a workaround solution by building interface with grids and query Entity as the following:

    a!localVariables(
    local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5),
    local!appliedJobsData: a!queryEntity(
    entity: cons!ApplicantDS,
    query: a!query(
    selection: a!querySelection(columns: {
    a!queryColumn(
    field: "ID"
    ),
    a!queryColumn(
    field: "appliedJobs"
    )
    }),
    pagingInfo: local!pagingInfo,
    filter: a!queryFilter(
    field: "ID",
    operator: "=",
    value: tointeger(user(loggedInUser(),"customField1"))
    )
    ),
    fetchTotalCount: true
    ),
    a!gridField(
    label: "الوظائف التى تم التقديم عليها",
    labelPosition: "ABOVE",
    data: local!appliedJobsData,
    columns: {
    a!gridColumn(
    label: "العنوان",
    value: fv!row.appliedJobs.employer.Address
    ),
    a!gridColumn(
    label: "وصف الوظيفة",
    value: fv!row.appliedJobs.jobPost.JobDescription
    ),
    a!gridColumn(
    label: "الراتب",
    value: fv!row.appliedJobs.jobPost.Salary
    ),
    a!gridColumn(
    label: "الوظيفة",
    value: fv!row.appliedJobs.jobPost.Title
    ),
    a!gridColumn(
    label: "اسم الشركة",
    value: fv!row.appliedJobs.employer.Name
    )
    },
    pagingsaveinto: local!pagingInfo
    )
    )

 Discussion posts and replies are publicly visible