web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

If project manager is disabled(means the user is not active) , do not allow to win the opportunity and throw some alert message.

(0) ShareShare
ReportReport
Posted on by 105

I have a requirement to throw alert message on win button if the project manager is not a active one. How can we do it through javascript? Any guidance

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: If project manager is disabled(means the user is not active) , do not allow to win the opportunity and throw some alert message.

    You can use JavaScript and Ribbon Workbench for Dynamics 365 to achieve the requirement. you need to write the code to check the status of project manager from system user then on that basis you can display alert.

    Please refer below related links if these are helpful for you.

    https://carldesouza.com/dynamics-365-javascript-get-user/

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/218804/how-to-retrieve-a-user-s-teams-javascript

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/296994/javascript-code-to-check-current-users-team/854562

    Thanks,

    Goloknath

  • Verified answer
    Community Member Profile Picture
    on at
    RE: If project manager is disabled(means the user is not active) , do not allow to win the opportunity and throw some alert message.

    Hi Rits,

    You can try to achieve it with OOB sync workflow, which is one no code way.

    In that we get the option of Stop Workflow and with cancelled status we can set the message as well.

    Due to the workflow's own limitation of not being able to get the field value of the parent record of the parent records(across two levels), you need get manager of the user firstly.

    Steps:

    1.Create another user lookup field to store user's manager, which also can be achieve through workflow:

    pastedimage1632125026637v2.png

    pastedimage1632125630558v3.png

       Or you can use other ways to get status of user's manager, and pass it to the opportunity form.

    2.Then you can crate another real-time workflow to show alert message:

    pastedimage1632126523750v4.png

    Test:

    pastedimage1632126653438v6.png

    pastedimage1632126626790v5.png

  • Community Member Profile Picture
    on at
    RE: If project manager is disabled(means the user is not active) , do not allow to win the opportunity and throw some alert message.

    Hi Partner,

    Has the problem been solved? Any updates?

    Please click Yes under "Did this answer your question?" to close this thread.

     Image

    Thanks. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 159

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 152

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 134 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans