Prepopulating Data

I have a reference CDT for organization details. Here my requirements are when I select an organization name the tax id and address should be prepopulated. 

Is there any way to get this requirement done!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    a!localVariables(
    local!organisationName:cons!ST_LABEL_ORGANISATION_NAME,  
    local!organisationTaxID:cons!ST_ORGANISATION_TAXID_VALUES,
    local!organisationAddress:cons!ST_ORGANISATION_ADDRESS,
    
      
      {
      a!sectionLayout(
        label: "Section",
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        item: a!dropdownField(
                          label: "Organisation Name",
                          labelPosition: "ABOVE",
                          placeholder: "--- Select a Value ---",
                          choiceLabels: {local!organisationName},
                          choiceValues: {local!organisationName},
                          value: ri!organisationName,
                          saveInto: {
                            ri!organisationName,
                            if(isnull(ri!organisationName),
                          {a!save(ri!organisationTaxID,null)
                          
                         },{}),
                          {a!save(ri!organisationTaxID,local!organisationTaxID),
                          if(isnull(ri!organisationName),
                          {a!save(ri!organisationAddress,null)
    
                          },{}),
                          {a!save(ri!organisationAddress,local!organisationAddress)
                          }
                          
                          
                          }},
                          searchDisplay: "AUTO",
                          validations: {}
                        )
                      )
                    }
                  ),
                  a!textField(
                    label: "Organisation Tax ID",
                    labelPosition: "ADJACENT",
                    value:{
                     ri!organisationTaxID
                    },
                    saveInto: {
                      ri!organisationTaxID
                    },
                    refreshAfter: "UNFOCUS",
                    readOnly: true,
                    validations: {}
                  )
                }
              ),
              a!columnLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        item: a!floatingPointField(
                          label: "Donation Amount",
                          labelPosition: "ABOVE",
                          saveInto: {},
                          refreshAfter: "UNFOCUS",
                          validations: {}
                        )
                      )
                    }
                  ),
                  a!textField(
                    label: "Organisation Address",
                    labelPosition: "ADJACENT",
                    value:ri!organisationAddress,
                    saveInto: {ri!organisationAddress},
                    refreshAfter: "UNFOCUS",
                    readonly:true(),
                    validations: {}
                  )
                  
                }
              )
            }
          )
        }
      )
    })

    Here I used constants, instead of that use lookup tables and store values in the tables, query the data by using expression rules based on the primary key of the lookup tables.

Reply
  • 0
    Certified Senior Developer

    a!localVariables(
    local!organisationName:cons!ST_LABEL_ORGANISATION_NAME,  
    local!organisationTaxID:cons!ST_ORGANISATION_TAXID_VALUES,
    local!organisationAddress:cons!ST_ORGANISATION_ADDRESS,
    
      
      {
      a!sectionLayout(
        label: "Section",
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        item: a!dropdownField(
                          label: "Organisation Name",
                          labelPosition: "ABOVE",
                          placeholder: "--- Select a Value ---",
                          choiceLabels: {local!organisationName},
                          choiceValues: {local!organisationName},
                          value: ri!organisationName,
                          saveInto: {
                            ri!organisationName,
                            if(isnull(ri!organisationName),
                          {a!save(ri!organisationTaxID,null)
                          
                         },{}),
                          {a!save(ri!organisationTaxID,local!organisationTaxID),
                          if(isnull(ri!organisationName),
                          {a!save(ri!organisationAddress,null)
    
                          },{}),
                          {a!save(ri!organisationAddress,local!organisationAddress)
                          }
                          
                          
                          }},
                          searchDisplay: "AUTO",
                          validations: {}
                        )
                      )
                    }
                  ),
                  a!textField(
                    label: "Organisation Tax ID",
                    labelPosition: "ADJACENT",
                    value:{
                     ri!organisationTaxID
                    },
                    saveInto: {
                      ri!organisationTaxID
                    },
                    refreshAfter: "UNFOCUS",
                    readOnly: true,
                    validations: {}
                  )
                }
              ),
              a!columnLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        item: a!floatingPointField(
                          label: "Donation Amount",
                          labelPosition: "ABOVE",
                          saveInto: {},
                          refreshAfter: "UNFOCUS",
                          validations: {}
                        )
                      )
                    }
                  ),
                  a!textField(
                    label: "Organisation Address",
                    labelPosition: "ADJACENT",
                    value:ri!organisationAddress,
                    saveInto: {ri!organisationAddress},
                    refreshAfter: "UNFOCUS",
                    readonly:true(),
                    validations: {}
                  )
                  
                }
              )
            }
          )
        }
      )
    })

    Here I used constants, instead of that use lookup tables and store values in the tables, query the data by using expression rules based on the primary key of the lookup tables.

Children
No Data