Conditional Required on fields not working

  a!cardLayout(
    contents: {
      a!columnsLayout(
        spacing: "DENSE",
        columns: {
          a!columnLayout(
            contents: {
              a!sideBySideLayout(
                items: {
                  a!sideBySideItem(
                    width: "2X",
                    item: a!richTextDisplayField(
                      value: a!richTextItem(
                        text: " Validate Lead Viable",
                        style: "STRONG",
                        size: "MEDIUM_PLUS"
                      )
                    )
                  ),
                  
                }
              )
            }
          )
        }
      ),
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!dropdownField(
                label: "Does this lead have INN Facility Privileges?",
                helpTooltip: "Privileges not applicable if its a PT/OT/PCP",
                labelPosition: "ABOVE",
                choiceLabels: { "Yes", "No" },
                choiceValues: { true(), false() },
                required: if(
                  or(
                    a!isNullOrEmpty(local!eligibleProviderType),
                    local!eligibleProviderType = false()
                  ),
                  false(),
                  true()
                ),
                placeholder: "------Select Value------",
                value: local!innFacilityPrivileges,
                saveInto: local!innFacilityPrivileges
              ),
              a!textField(
                label: "Facility Privilege",
                required: if(
                  or(
                    a!isNullOrEmpty(local!innFacilityPrivileges),
                    local!innFacilityPrivileges = false()
                  ),
                  false(),
                  true()
                ),
                labelPosition: "ABOVE",
                characterLimit: 255,
                value: local!tertiaryFacilityPrivilege,
                saveInto: local!tertiaryFacilityPrivilege
              ),
              
            }
          ),
          
        }
      ),
      a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Save",
            style: "PRIMARY",
            confirmButtonLabel: "Submit",
            confirmHeader: "Do you want to proceed?",
            cancelButtonLabel: "Cancel",
            confirmMessage: "review will be scheduled , once you click submit",
            
          ),
          
        }
      )
    },
    shape: "SEMI_ROUNDED",
    padding: "LESS",
    marginBelow: "STANDARD",
    showBorder: false,
    showShadow: true
  )


Any idea how to do conditional required on fields work ? as i have tried but it did nt worked

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    This has always been working for me. Did you validate your logic?

  • yes i validated .. evrytime it works .. but dont know why it is not working 

    a!localVariables(
      
      local!innFacilityPrivileges,
      local!tertiaryFacilityPrivilege,
      a!cardLayout(
        contents: {
          a!columnsLayout(
            spacing: "DENSE",
            columns: {
              a!columnLayout(
                contents: {
                  a!sideBySideLayout(
                    items: {
                      a!sideBySideItem(
                        width: "2X",
                        item: a!richTextDisplayField(
                          value: a!richTextItem(
                            text: " Validate Lead Viable",
                            style: "STRONG",
                            size: "MEDIUM_PLUS"
                          )
                        )
                      ),
                      
                    }
                  )
                }
              )
            }
          ),
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!dropdownField(
                    label: "Does this lead have INN Facility Privileges?",
                    helpTooltip: "Privileges not applicable if its a PT/OT/PCP",
                    labelPosition: "ABOVE",
                    choiceLabels: { "Yes", "No" },
                    choiceValues: { true(), false() },
                    placeholder: "------Select Value------",
                    value: local!innFacilityPrivileges,
                    saveInto: local!innFacilityPrivileges
                  ),
                  a!textField(
                    label: "Facility Privilege",
                    required: if(
                      local!innFacilityPrivileges = false(),
                      false(),
                      true()
                    ),
                    labelPosition: "ABOVE",
                    characterLimit: 255,
                    value: local!tertiaryFacilityPrivilege,
                    saveInto: local!tertiaryFacilityPrivilege
                  ),
                  
                }
              ),
              
            }
          ),
          a!buttonLayout(
            primaryButtons: {
              a!buttonWidget(
                label: "Save",
                style: "PRIMARY",
                confirmButtonLabel: "Submit",
                confirmHeader: "Do you want to proceed?",
                cancelButtonLabel: "Cancel",
                confirmMessage: "review will be scheduled , once you click submit",
                
              ),
              
            }
          )
        },
        shape: "SEMI_ROUNDED",
        padding: "LESS",
        marginBelow: "STANDARD",
        showBorder: false,
        showShadow: true
      )
    )

  • 0
    Certified Lead Developer
    in reply to Klaus34

    I see this.

    You should initialize your local correctly.

Reply Children
No Data