Skip to main content
Inspiring
Nov 6, 2024 5:36 PM UTC
Question

RE: Button

Hi All,

I am trying to hide one button based on condition, that initiator cannot see that button it is working in UI level but it is not working in site, 

showWhen: and(
                      not(local!isCurrentUserInitiator_bool),
                      or(
                        and(
                          /*local!actionTypeId_int <> cons!CR_CREDIT_ACTION_TYPE_IDS[8],*/
                          local!actionTypeId_int <> cons!CR_CREDIT_ACTION_TYPE_IDS[14],
                          a!isUserMemberOfGroup(
                            loggedInUser(),
                            cons!CR_GRP_CREDIT_CONTROLLER_GROUP
                          ),
                          rule!APN_isBlank(
                            local!moduleRecommendationStatus_cdt.approver_txt
                          )
                        ),
                        if(
                          index(
                            local!approver_cdt,
                            "isApproveDisplay_bool",
                            false()
                          ),
                          true(),
                          false()
                        ),
                        
                      )
                    ),

and local!isCurrentUserInitiator_bool: local!loggedinUser_txt = ri!crModuleStatus_cdt.addedBy_txt(ri!crModuleStatus_cdt.addedBy_txt is cmg same as local!isCurrentUserInitiator_bool)

I am trying to add  logic on top of or condition that Initiator of the workflow cannot see the button,

Here  isCurrentUserInitiator_bool: true, approver_txt:blank and isApproveDisplay_bool: false.

Can any one help me to fix this issue . Still Initiator can see the button which should not be visible).

Thanks In Advance

    2 replies

    shanmathip7466
    Inspiring
    Nov 6, 2024 5:56 PM UTC

    Hi [mention:ef0fbf994c9643cd84ee894e18f03e86:e9ed411860ed4f2ba0265705b8793d05] ,

    Could you please try to display the variables local!isCurrentUserInitiator_bool,    local!moduleRecommendationStatus_cdt.approver_txt and  index(
    local!approver_cdt,
    "isApproveDisplay_bool",
    false()
    ) in a paragraph field for testing purpose and see the values in the SITE whether you are getting the expected values?

    somasundaram.d
    Employee
    Nov 7, 2024 7:47 AM UTC

    You can try printing the variable values and troubleshoot. I suspect not(local!isCurrentUserInitiator_bool) to be the cause, instead of not() can you try 

    local!isCurrentUserInitiator_bool = true or local!isCurrentUserInitiator_bool = false

    whichever is right for your case