Skip to main content

Notifications

Announcements

No record found.

Customer Service forum
Unanswered

Pop out an error dialog box message when trying to resolve a case, when a field is empty.

Posted on by 6

Hi, I am looking for a JavaScript solution for the following scenario:

In the case form, when we click on “Resolve Case” button, it will check if a text field has data being updated or not. If it is blank, a message should pop-up and it should not allow to resolve the case until the field has been updated. Note: the field is not mandatory, but it needs to be filled before resolving

Currently we are using Ribbon Workbench, we used Run workflow and in the Error Callback JavaScript we added Xrm.Navigation.openAlertDialog({text: /Cannot resolve this case. Possible Cause: Please check if all child cases has been resolved/}); but still this does not check the condition.

Is there any possibility where we can achieve this with JavaScript code?

Categories:
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Pop out an error dialog box message when trying to resolve a case, when a field is empty.
    There are some possibilities.
    You can delete the previous js code and test it again.
  • Salesian Profile Picture
    Salesian 6 on at
    Pop out an error dialog box message when trying to resolve a case, when a field is empty.
    Could it be the Error Callback Message is conflicting with the workflow status message?
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Pop out an error dialog box message when trying to resolve a case, when a field is empty.
    Hi Salesian,
    It's so strange!
    Maybe you can try to copy it to create another workflow to test again.
    Or try to create one new workflow on other entities to check if the same situation occurs.
  • Salesian Profile Picture
    Salesian 6 on at
    Pop out an error dialog box message when trying to resolve a case, when a field is empty.
    Hi Leah,

    Thank you so much, this is helpful.

    I have implemented the steps you shared.
    It is working, the cases are not being resolve when the field does not contain data.
    However, the error message is not popping out.
    Just as you had instructed, I have followed all the steps, I included the value as well under the set properties for the stop workflow with status of cancelled.
    Can you please help on this?
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Pop out an error dialog box message when trying to resolve a case, when a field is empty.
    Hi Salesian,
    Why not use workflow to get there directly?
    We can do this by using a Real-time (synchronous) workflow which triggers after a status change.
    Go to Settings > Process.
    1)Create one workflow on case entity:
    2)Trigger: 
    3)Add steps:
    --Condition:
    --Add a Stop Workflow step with a status of Cancelled
    4)Save and active.
    When your condition is True, this workflow will create an error message, and because the workflow is synchronous, it will also prevent the status from changing to Resolved.

    I hope you can mark my answer verified if it is helpful! If you have any questions, please feel free to contact me.
    Regards,
    Leah

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans