You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Custom smart action in account object not working for sales rep role

Summary:

we have one smart action called as run credit in account object, this smart action works as expected for sales admin role users but not for sales rep roles

Content (please ensure you mask any confidential information):


Version (include the version you are using, if applicable):



Code Snippet (add any code snippets that support your topic, if applicable):

define([
'vb/action/actionChain',
'vb/action/actions',
'vb/action/actionUtils',
], (
ActionChain,
Actions,
ActionUtils
) => {
'use strict';

class accountsOnBeforeInvokeSmartActionEventListener extends ActionChain {

/**
 * @param  {Object} context
 * @param  {Object} params
 * @param  {{continue:boolean,layoutId:string,actionConfig:object}} params.previous
 * @param  {{action:object,row:object,functions:any}} params.event
 * @return  {{continue:boolean,layoutId:string,actionConfig:object}}
 */
async run(context, { previous, event }) {
  const { $layout, $base, $extension, $responsive, $user, $constants, $variables } = context;

  const action = event.action;
  const current = Object.assign({}, previous);
  if (action?.UserActionName === 'CUST-RunCredit-accounts') // UserActionName of custom smart action
  {
    document.getElementById('oj-dialog-1518547175-1').open();
    return {
      continue: false
    };

  }

  // return previous;
}
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!