Hello @skolisetti,
As per out of the box button, there is some predefault function will be available. In Your Case its in order Entity.
1. Create an solution and Add an Entity Called Order
2. Import Ribbon Work bench Solution attached here
3. Open the Created Solution in the Ribbon Work bench
4. Click On Close Order Button then Right Click and Click Customize Command
5. Then Click On Command And Copy the library name and Function Name in Note Pad
6. Now Create a new Web Resource and inside the code
--> Make an ODATA Call and Retrieve Tasks with Active Status against this Order.
--> If the Count is Greater than Zero Show Alter Dialog as "There is already Task Available"
Else
--> Paste the Function which you Copied at the point number 5
7. Now Point No 6 Web Resource and Function Name in the Ribbon work Bench by Replacing Point Number 5.
8. Click on Publish
Thats it 🙂
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com