Trifecta day: How does one create an array of CDT's such that each element

Trifecta day: How does one create an array of CDT's such that each element is identical. Our users wish to be able to order N amount of an item, then tailor the ones with unique characteristics. So say I have an array of CDT's describing standard widgets. Our uses wish to pick from our catalog and order 10 of our reverse thread 3/8mm trammel wire widgets. Then subsequently have two of them painted mauve. I want to create an array of ten, then let them change the color field to mauve on two of the ten.

Help?

OriginalPostID-156544

OriginalPostID-156544

  Discussion posts and replies are publicly visible

Parents
  • The below creates an array of widget CDTs with no colours applied. You could then map this to an editable grid and allow the colours to be changed. You'd probably want to use the id field as set when editing the grid, but then clear that element when writing to the database so that they are replaced with "real" ids.

    load(
    local!ids: {1,2,3},
    local!names: {"Widget 1","Widget 2","Widget 3"},
    local!colours: {"", "", ""},
    apply(
    type!widget(
    id: _,
    name: _,
    colour: _
    ),
    merge(
    local!ids,
    local!names,
    local!colours
    )
    )
    )
Reply
  • The below creates an array of widget CDTs with no colours applied. You could then map this to an editable grid and allow the colours to be changed. You'd probably want to use the id field as set when editing the grid, but then clear that element when writing to the database so that they are replaced with "real" ids.

    load(
    local!ids: {1,2,3},
    local!names: {"Widget 1","Widget 2","Widget 3"},
    local!colours: {"", "", ""},
    apply(
    type!widget(
    id: _,
    name: _,
    colour: _
    ),
    merge(
    local!ids,
    local!names,
    local!colours
    )
    )
    )
Children
No Data