Skip to main content
moulikad5353
Known Participant
Sep 19, 2023 2:30 PM UTC
Question

How do I use the "disable" function ?

a!sideBySideItem(
          item: a!pickerFieldCustom(
            labelPosition: "COLLAPSED",
            placeholder: "Department",
            suggestFunction: rule!INO_departmentSearchSuggestFunction(
              nameList: if(
                rule!INO_isBlank(ri!selectedDepartmentList),
                ri!departmentList.departmentDescription,
                index(
                  remove(
                    ri!departmentList,
                    wherecontains(
                      ri!selectedDepartmentList,
                      ri!departmentList
                    )
                  ),
                  "departmentDescription",
                  null
                )
              ),
              departmentList: if(
                rule!INO_isBlank(ri!selectedDepartmentList),
                ri!departmentList,
                remove(
                  ri!departmentList,
                  wherecontains(
                    ri!selectedDepartmentList,
                    ri!departmentList
                  )
                )
              ),
              filter: _
            ),
            selectedLabels: index(
              ri!selectedDepartmentList,
              "departmentDescription",
              null
            ),
            value: ri!selectedDepartmentList,
            disabled: if(
              ri!byMonthOrWeek = cons!INO_REPORT_BY_SUMMARY,
              true,
              false
            ),
            saveInto: {
              ri!selectedDepartmentList,
              a!save(ri!selectedStaffList, null),
              a!save(ri!selectedSupervisorList, null),
              a!save(ri!selectedManagerList, null),
              a!save(ri!selectedSeniorManagerList, null),
              a!save(ri!selectedJobRoleList, null),
              a!save(ri!selectedStaffListReport, null),
              a!save(ri!selectedRegionList, null),
              a!save(ri!selectedRegionsSupportingList, null)
            }
          ),
          showWhen: and(
            not(
              a!isUserMemberOfGroup(loggedInUser(), cons!INO_GRP_STAFF)
            ),
            or(
              and(
                a!isUserMemberOfGroup(
                  loggedInUser(),
                  cons!INO_GRP_SUPERVISORS
                ),
                local!supervisorHasLD
              ),
              contains(
                {
                  cons!INO_DESIG_ID_SENIOR_DIRECTOR,
                  cons!INO_DESIG_ID_DIRECTOR,
                  cons!INO_DESIG_ID_MANAGER,
                  cons!INO_DESIG_ID_SENIOR_MANAGER
                },
                ri!employee.designationId
              )
            ),
            ri!togglePickers
          )
        ),

I use here "disable", but it is not working. Can you please tell me how is it working now?

    2 replies

    stefanhelzle0001
    Brainy
    Sep 19, 2023 2:39 PM UTC

    What does "it is not working" mean?

    Did you check that the logic you use is correct? Did you try to just set it to true or false?

    mikes0011
    Brainy
    Sep 19, 2023 2:47 PM UTC

    What are the values of these two items?  You've shared a large snippet of code here but we have no way of knowing what these would evaluate to which would determine the status of your "disabled" parameter.

    As Stefan said, does it work if you just set it to a value of "true"?  If that works but your code doesn't, then you will need to troubleshoot your code.

    The Expression Guru