I want to update an A cdt with another B cdt which is subset of A cdt. Is there

I want to update an A cdt with another B cdt which is subset of A cdt. Is there any existing function or an easy way to achieve this goal?

OriginalPostID-218216

OriginalPostID-218216

  Discussion posts and replies are publicly visible

Parents
  • You can create a expression rule and pass cdtA and cdtB into it. Use type!cdtA() and map the cdtA fields with cdtB fields.
    Ex:
    type!cdtA(
    id: if(APP_isnull(ri!cdtB.id),ri!cdtA.id,ri!cdtB.id)
    name: if(APP_isnull(ri!cdtB.name),ri!cdtA.name,ri!cdtB.name)
    gender: if(APP_isnull(ri!cdtB.gender),ri!cdtA.gender,ri!cdtB.gender)
    age: ri!cdtA.age /* If age field is present only in cdtA and not in cdtB */
    )

    This way you can update the cdtA efficiently preserving the non-common fields also.

    Lets me know if the information was helpful.
Reply
  • You can create a expression rule and pass cdtA and cdtB into it. Use type!cdtA() and map the cdtA fields with cdtB fields.
    Ex:
    type!cdtA(
    id: if(APP_isnull(ri!cdtB.id),ri!cdtA.id,ri!cdtB.id)
    name: if(APP_isnull(ri!cdtB.name),ri!cdtA.name,ri!cdtB.name)
    gender: if(APP_isnull(ri!cdtB.gender),ri!cdtA.gender,ri!cdtB.gender)
    age: ri!cdtA.age /* If age field is present only in cdtA and not in cdtB */
    )

    This way you can update the cdtA efficiently preserving the non-common fields also.

    Lets me know if the information was helpful.
Children
No Data