I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2 I

I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2
I have to compare CDT1.id = CDT2.id
if the ids match then CDT1.value is to be update by CDT2.value

Please let me know if you have any solution.

OriginalPostID-186559

OriginalPostID-186559

  Discussion posts and replies are publicly visible

Parents
  • Hi rishij,

    This is my understanding of the requirement: Value of CDT1.value is to be replaced with CDT2.value when the CDT2.id matches CDT1.id
    For this I propose the following solution in two steps.

    1. To get the updated array of CDT1.value you can use the displayValue function

    Ref code: apply(fn!displyValue(value: _, inArray: CDT1.id, replacement: CDT2.value, default: default value), CDT2.id)

    2. In order to set it to CDT1.value you can use the shared component specified by tim.clarke.

    Ref code:
    updatecdt(CDT1, { value: {updated array} })
Reply
  • Hi rishij,

    This is my understanding of the requirement: Value of CDT1.value is to be replaced with CDT2.value when the CDT2.id matches CDT1.id
    For this I propose the following solution in two steps.

    1. To get the updated array of CDT1.value you can use the displayValue function

    Ref code: apply(fn!displyValue(value: _, inArray: CDT1.id, replacement: CDT2.value, default: default value), CDT2.id)

    2. In order to set it to CDT1.value you can use the shared component specified by tim.clarke.

    Ref code:
    updatecdt(CDT1, { value: {updated array} })
Children
No Data