Stakeholders

Community Alums
Not applicable

Hello Team,

 

I have received below task , please advise on following.

 

1. New button of  stakeholder related list  on demand form should be visible to Demand Manager only

2. When the demand state moves to Screening a notification should get sent to stakeholders having Assessment recipient set to TRUE.

3.Before approving demand there should be at least one resource plan else demand should not get approved, it should pop up an error message.

4. "Create Project" ui action link should be visible for only approved demand.

 

Please advise. 

 

3 ACCEPTED SOLUTIONS

Ratnakar7
Mega Sage
Mega Sage

Hi @Community Alums ,

 

Here are the steps you can take to accomplish the tasks:

  1. To make the "New" button of the stakeholder related list visible only to the Demand Manager, you can use a UI Policy. Create a UI Policy that applies to the "New" button and set its condition to check if the logged-in user is the Demand Manager. If the condition is true, then set the UI Policy action to "Make Visible". Otherwise, set the action to "Make Hidden".

  2. To send a notification to stakeholders when the demand state moves to Screening and their Assessment recipient field is set to true, you can create a Business Rule. The Business Rule should trigger when the demand state is updated to Screening. In the Business Rule, you can use a GlideRecord query to retrieve all the stakeholders whose Assessment recipient field is set to true and send them a notification.

  3. To ensure that there is at least one resource plan before approving a demand, you can use a Client Script. Create a Client Script that runs on the demand approval form and checks if there is at least one resource plan. If there is no resource plan, then show an error message to the user and prevent the demand from being approved.

  4. To make the "Create Project" UI action link visible only for approved demands, you can use a UI Action. Create a UI Action that applies to the "Create Project" link and set its condition to check if the demand is approved. If the condition is true, then set the UI Action to "Make Visible". Otherwise, set the action to "Make Hidden".

I hope this helps! Let me know if you have any questions or need further assistance.

 

If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.

 

Thank you!

Ratnakar

 

View solution in original post

Hi @Community Alums ,

Sure, here's an example code for the Business Rule that sends a notification to stakeholders when the demand state moves to Screening:

// Run the Business Rule when the demand state is updated to Screening
if (current.state.changesTo('screening')) {

  // Retrieve the stakeholders whose Assessment recipient field is set to true
  var gr = new GlideRecord('sc_req_item_stakeholder');
  gr.addQuery('request_item', current.sys_id);
  gr.addQuery('assessment_recipient', true);
  gr.query();

  // Send a notification to each stakeholder
  while (gr.next()) {
    var recipient = gr.getValue('stakeholder');
    var notification = new GlideRecord('sysevent_email_template');
    if (notification.get('name', 'Demand Screening Notification')) {
      gs.eventQueue('email.send', notification, 'request_item', current.sys_id, recipient);
    }
  }
}

 

Thanks,

Ratnakar

View solution in original post

@Community Alums 

In your existing ui action-create Project ,there is a condition box ,you just have to add below line

current.state=approved(here add exact value of approved choice)

 

Thanks,

Manjusha Bangale

View solution in original post

12 REPLIES 12

Community Alums
Not applicable

@Ratnakar7  PLz reply 

Community Alums
Not applicable

Hello @Ratnakar7  Could you please explain step by step First Question We tried implement in UI policy , However unable to achieve the solution. as we are new to Demand management.

 

Please Advise.

 

Thank you. 

manjusha_
Kilo Sage

@Community Alums 

 

1.To hide new button -go to list control ,and provide role with which users should see New button ,use below screen shot

manjusha__0-1680175334321.png

manjusha__1-1680175433764.png

2.

When the demand state moves to Screening a notification should get sent to stakeholders having Assessment recipient set to TRUE-create async  business rule to trigger event from the business rule .

3.To check at least one resource plan ,you have to create a before business rule ,abort operation if there is no resource plan for the specific demand

4. In existing  "Create Project" ui action -update condition with state as approved 

Let me know if you need any more help

Thanks,

Manjusha Bangale

 

Community Alums
Not applicable

Hello ,

 

Can you explain me Question number 4 step by step.

 

Thank you. 

@Community Alums 

In your existing ui action-create Project ,there is a condition box ,you just have to add below line

current.state=approved(here add exact value of approved choice)

 

Thanks,

Manjusha Bangale