Show value by choosing an option

Hello,

Inside my cdt I have a group called country, within it I have three groups and in each one I have a user with their data.
My question is, of a form with two fields, in the first I choose the user and after choosing it I want that in the second field I get your telephone number

Thanks

  Discussion posts and replies are publicly visible

Parents
  • Please elaborate more, if you choose the user from first field, want to display user related telephone in second field automatically?
  • yes, i want to display user related telephone in second field automatically
    This in my code.
    I would like to know what should I put where "xxxxx" is if that part of the code is ok.


    Thanks


    load(
    local!group: cons!ct_filter,
    {
    a!pickerFieldUsers(
    label: "Contact",
    labelPosition: "ADJACENT",
    maxSelections: 1,
    groupfilter: local!group,
    value: ri!new.office,
    saveInto: ri!new.office,
    required: true,
    validations: {}
    ),

    a!textField(
    label: "telephone",
    labelPosition: "ADJACENT",
    value: user(xxxxxxxxxx,"phoneMobile"),
    saveInto: ri!nuevasSolic.telephoneContact,
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
    }

    )
  • +1
    Certified Lead Developer
    in reply to Alastr

    You need to save the telephone number in the first picker field. Something like

     

    load(
    local!group: cons!ct_filter,
    {
    a!pickerFieldUsers(
    label: "Contact",
    labelPosition: "ADJACENT",
    maxSelections: 1,
    groupfilter: local!group,
    value: ri!new.office,
    saveInto: {
        ri!new.office,
        a!save(ri!nuevasSolic.telephoneContact, user(save!value, "phoneMobile"))
    }
    required: true,
    validations: {}
    ),
    
    a!textField(
    label: "telephone",
    labelPosition: "ADJACENT",
    value: ri!nuevasSolic.telephoneContact,
    saveInto: ri!nuevasSolic.telephoneContact,
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {} 
    )
    }
    
    )

Reply
  • +1
    Certified Lead Developer
    in reply to Alastr

    You need to save the telephone number in the first picker field. Something like

     

    load(
    local!group: cons!ct_filter,
    {
    a!pickerFieldUsers(
    label: "Contact",
    labelPosition: "ADJACENT",
    maxSelections: 1,
    groupfilter: local!group,
    value: ri!new.office,
    saveInto: {
        ri!new.office,
        a!save(ri!nuevasSolic.telephoneContact, user(save!value, "phoneMobile"))
    }
    required: true,
    validations: {}
    ),
    
    a!textField(
    label: "telephone",
    labelPosition: "ADJACENT",
    value: ri!nuevasSolic.telephoneContact,
    saveInto: ri!nuevasSolic.telephoneContact,
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {} 
    )
    }
    
    )

Children