Display Referance Data

Certified Lead Developer
Hi,
I have below scenarion , I am looking for some design practices for it

I have Employee list in Employee CDT

--------------------------------------

Employee
----------
empId
firstName
lastName
designationId



Designation
---------------
designationId
designationDescription


I want to show employee empId,firstName,designationDescription in grid.
Whats are the best possible solution to show designationDescription in grid with minimum number of database calls.

Below are some solution approach i have in my list
1. Create view for Employee Details
Cons:
1. Need to create extra view and CDT
2. Pass designationId list and get designationDescirption
Cons:
Desgination desciption might not come in sorted order of desgination id for in operator

OriginalPostID-261448

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I have followed below approach
    1. Fetch the reference data only for input designation id list
    2. Create key value pair designation and designation description
    3. Fetch the description from Key value pair list one by one for input designation id list
    ----------------------------------------------

    load(
    /*Get the Designation data from database only for input designation ids*/
    local!designationList: rule!APP_GetDesignationList(
    selectColumns: {
    "designationId",
    "description"
    },
    designationIdList: ri!designationIdList
    ).data,

    /*Create Key Value Pair for designation ids and description*/
    local!designationKeyValueList: apply(
    rule!mo_getKeyValuePairCDT,
    merge(
    local!designationList.designationId,
    local!designationList.description
    )
    ),

    /*Pass the input designation id one by one and get the description so that description will be in sorted order of input designationIdList*/
    apply(
    rule!APP_GetValueForKey,
    ri!designationIdList,
    local!designationKeyValueList
    )
    )
Reply
  • 0
    Certified Lead Developer
    I have followed below approach
    1. Fetch the reference data only for input designation id list
    2. Create key value pair designation and designation description
    3. Fetch the description from Key value pair list one by one for input designation id list
    ----------------------------------------------

    load(
    /*Get the Designation data from database only for input designation ids*/
    local!designationList: rule!APP_GetDesignationList(
    selectColumns: {
    "designationId",
    "description"
    },
    designationIdList: ri!designationIdList
    ).data,

    /*Create Key Value Pair for designation ids and description*/
    local!designationKeyValueList: apply(
    rule!mo_getKeyValuePairCDT,
    merge(
    local!designationList.designationId,
    local!designationList.description
    )
    ),

    /*Pass the input designation id one by one and get the description so that description will be in sorted order of input designationIdList*/
    apply(
    rule!APP_GetValueForKey,
    ri!designationIdList,
    local!designationKeyValueList
    )
    )
Children
No Data