Skip to main content
November 18, 2023
Question

record action is not visible in interface

  • November 18, 2023
  • 16 replies
  • 0 views

a!localVariables(
  local!userDtl: rule!GAI_GetUserDetailByUserDetailId(id: ri!userDtlId),
  local!userAddr: rule!GAI_getUserAddress(userDtlId: ri!userDtlId),
  local!address: rule!GAI_getAddress(
    addressId: tointeger(
      local!userAddr['recordType!{95223579-776a-485d-b38c-eeaedbe5930a}GAI User Address.fields.{42a88eac-f478-4bf9-a8da-e8c5e666ed11}fkAddressId']
    )
  ),
  local!userRoles: a!refreshVariable(
    value: rule!GAI_getUserRole(
      userDetailId: ri!userDtlId,
      isActive: true()
    ),
    refreshAfter: "RECORD_ACTION",
    refreshAlways: true()
  ),
  a!formLayout(
    contents: {
      rule!SCO_CommonHelpText(
        helpText: "User has been deactivated in the system",
        isError: true(),
        showWhen: not(
          rule!SCO_isUserActive(
            local!userDtl['recordType!{1a68a647-eb88-4f12-be8e-e3d5fc6495eb}GAI User Detail.fields.{d07378d8-ee37-479d-a6e4-06adfb5bdd15}username']
          )
        )
      ),
      a!columnsLayout(
        columns: {
          a!columnLayout(
            width: "NARROW",
            contents: {
              rule!GAI_CommonRecordActionField(
                recordAction: 'recordType!{1a68a647-eb88-4f12-be8e-e3d5fc6495eb}GAI User Detail.actions.{3fb24cc7-938f-47d5-b566-1d826e8e205f}updateUserDetail',
                actionNotRelatedToWorkflow: true(),
                identifier: { isUpdate: true(), userDtlId: ri!userDtlId },
                showWhen: true()
              )
            }
          ),
          a!columnLayout(
            width: "NARROW_PLUS",
            contents: {
              rule!GAI_CommonRecordActionField(
                recordAction: 'recordType!{1a68a647-eb88-4f12-be8e-e3d5fc6495eb}GAI User Detail.actions.{ebd775e8-8205-4708-9ff9-f62f1bb3fc3e}deactivateUser',
                actionNotRelatedToWorkflow: true(),
                identifier: { userDtlId: ri!userDtlId },
                showWhen: true()
              )
            }
          ),
          a!columnLayout(
            width: "NARROW_PLUS",
            contents: {
              rule!GAI_CommonRecordActionField(
                recordAction: 'recordType!{1a68a647-eb88-4f12-be8e-e3d5fc6495eb}GAI User Detail.actions.{666c057e-b750-49fd-b1cb-c039dc80ec7e}reactivateUser',
                actionNotRelatedToWorkflow: true(),
                identifier: { userDtlId: ri!userDtlId },
                showWhen: true()
              )
            }
          )
        }
      ),

Hii, 

Activate user Record action is visible but Deactivate user Record action is not visible in interface how can i resolve this ?

16 replies

jordand0005
November 18, 2023

Hi Sudhirs

Do the Activate User record action and the Deactivate User record action share the same process model?

If not I would recommend reviewing the configured security on each.

"By default, any user can see a record list action if they have Initiator permission to the underlying process model. For related actions, a user must be able to see the record and have Initiator permission to the underlying process model."

If this doesn't resolve the issue we need more detail to be able to help any further - what is the logic behind expression rule!GAI_CommonRecordActionField()?

November 20, 2023

Hi Jordan,

a!localVariables(
  local!recordSecurityResponse: rule!GAI_doesRecordActionApplyForUser(
    recordAction: ri!recordAction,
    workflowId: ri!workflowId,
    workflowTypeStatusId: ri!workflowTypeStatusId,
    actionNotRelatedToWorkflow: ri!actionNotRelatedToWorkflow
  ),
  local!doesRecordActionApplyForUser: index(
    local!recordSecurityResponse,
    "doesRecordActionApplyForUser",
    null
  ),
  local!groupsAllowed: index(
    local!recordSecurityResponse,
    "groupsAllowed",
    null
  ),
  local!statusValuesAllowed: index(
    local!recordSecurityResponse,
    "statusValuesAllowed",
    null
  ),
 
  a!recordActionField(
    display: if(
      a!isNullOrEmpty(ri!display),
      "LABEL_AND_ICON",
      ri!display
    ),
    style: if(
      a!isNullOrEmpty(ri!style),
      "TOOLBAR",
      ri!style
    ),
    showWhen: and(
      rule!SCO_isBoolBlankOrEmptyOrTrue(ri!showWhen),
      rule!SCO_isBoolNotEmptyAndTrue(local!doesRecordActionApplyForUser)
    ),
    actions: {
      a!recordActionItem(
        action: ri!recordAction,
        identifier: ri!identifier
      )
    }
  ),
 
)
i am using different PM for each, with sane security

November 20, 2023

based on this rule i am displaying Record action ,This rule should return True but it is returning FALSE only, how to resolve this 

annap0005
November 20, 2023

The related action will not display if the identifier is null or invalid. in your case its not the issue as you configured same identifier in both and you can see one.

Check the security of related action once.

November 20, 2023

Hi Anna,

i have displaying record action based on this rule

this should return true but returning false only 

November 20, 2023

Hi,

Is the Username a valid one?