My client wanted to remove (or hide) “Total Time” and “Billable Time” fields in the Case Close dialog window:
Of course, I knew that it is possible to open the file CRM_Installation_Directory\CRM\Web\CS\cases\dlg_closecase.aspx, add several lines of code, and hide fields and labels; but this, the most obvious and easiest way out, had 2 disadvantages:
1. This solution is unsupported and it could be broken with new Rollups.
2. This solution does not work for CRM Online.
So I decided to solve this task using supported approaches.
Step 1. Create a new solution and put the Case entity inside:
Step 2. Write JavaScript that will do the same work as the original dialog does (the best way is to use SOAP Logger application to get correct request/response xml) and add it to the solution.
Step 3: Create the dialog to be used instead of a standard one and add it to solution. It should look like following:
Step 4: Remove the original “Close Case” and create a new “Close Case” button using Ribbon Customization. I usually do it using Ribbon Workbench:
Publish the changes that you’ve made. Demonstration:
Andrii, this is brilliant, very well done, thanks!
Great Solution
Great job Andrii, can you share the javascript and the htm web resources please ?
Zoran
Thanks!
Thanks, Ivan! See you tomorrow 😉
Hello Zoran,
Send me an email, I will reply with attachments.
Kind regards,
Andrii.
You can send me an email on:
ivanov.zoran@gmail.com
thanks,
Zoran
If possible can I receive a copy also at,
richard.olivery@gmail.com
Thanks
Richard
If possible can i receive the javascript and webresource file?
topcl.biz@gmail.com
thanks,
topcl
Hi Andri , I need to explorer similar kind of customization required in Opportunity Close that is one of my client requirement …if possible can you share this code with me ?
satheshraman@gmail.com
Sent.
Sent.
Sent.
Good idea but I would suggest a simpler way. Create a CRM dialog and load that instead of the default dialog when the resolve button is pressed.
Hello Syl,
Thanks! I thought about suggested approach but one thing I was not able to do is dynamically fill optionset with status codes available for incident entity. Do you know how to do that?
Kind regards,
Andrii.
This is awesome, Great Job Andrii!!!
Great Stuff Andrii, I also have same similar requirement related to Opportunity Close. Could you share same code as Sathesh please. Thank you.
Hello,
Recheck the end of post – I've put reference to Skydrive where I've stored solution. Do you see it?
Kind regards,
Andrii.
Welcome!
Thank you very much Andrii..
Welcome!
Not sure doing it dynamically is worth it. Status Codes dont change that often.
Still, you could do this in the js that launches the dialog :
1) Check if the list of status codes changed.
2) If so update a global option set on which your Resolve case Dialog is based.
3) Launch your Resolve Case dialog.
If for some reason this behavior is still desired then you would have to add some js code that fires before you load the Dialog and verifys if the list of status codes changed.
You might also build a Custom Activity Workflow that would update the option set as the first step of your dialog.
Oh, yes, I see the files. Thanks
Hello Syl,
You are right, dialog can be used but If I'm not wrong anyway you would not be able to create incident resolution activity that is created during closing of incident. So you would not be able to close incident with proper fields mapping like description, resolution and so on.
Regarding custom workflow activity – at the moment it can be used but closing of incident would be done asynchronously and you will see the result only after some period of time.
Kind regards,
Andrii.
Great Job Andrii,
Sometime we do not want the resolve case dialog box itself.
I have written one post on my blog "How can be overwrite the resolve Case System ribbon button functionality?".
http://microxrm.blogspot.in/2013/01/overwrite-resolve-case-system-ribbon.html
Hello Mohammad,
Your article looks great, but you've used a plugin in your functionality. I believe that task can be completed without this step. I have already done this before and I will publish article soon how to do that.
This comment has been removed by the author.
Thanks Andrii,
I believe you will come up with better solution.
Thanks, I will try!
Something original. Love your work. Keep it up.
Appreciated, Amreek!
Can you Please sent the Javascript to me also . "athulmt@gmail.com"
Thanks in Advance !!
Hello Athul,
Recheck the bottom of post – it has reference to SkyDrive where you can download source code.
Hello Andrii,
I am getting an error when i am trying to import the solution.The error says the there are missing files which are : msa_partnercontactid of type field ,msa_contact_incident of type relationship,msa_contact_Incident of type relationship
thanks a lot 🙂
hallo
hallo, the source code ?
Hello Hussam,
Here is solution url – https://onedrive.live.com/?authkey=%21AP2OuIJIgP71JOM&id=F63E4BCD4A7F64A4%21223&cid=F63E4BCD4A7F64A4
Andrii
Hi! Perfect solution! Please, update link to solution, your one drive url contains only SureStep.exe. Thanks!
Thank you, Kirill. Looks like that file is lost and I’m really sorry for that.
thanks for sharing information
Can you please send me a copy as well? Please and Thank you!
WhiteA@bv.com
Thank you,
Angelia
Hello Angelia,
It was a long time ago and I don’t think I have solution files anymore. I believe you came to this post from my reply of Dynamics forum. My goal was to give you waypoints to achieve your goal.
Thanks,
Andrew
Hey Andrii, fantastic post, very informative and useful.
I was wondering if you could answer one question I have regarding this process. In step 2, you suggest using SOAP Logger application as a way to replicate functionality of the original buttons Javascript. Do you know if there is another way to view and replicate the functionality of the OOB buttons JavaScript now in CE Online?
I am trying to replicate most the OOB route button functionality but without the option to remove the item from the queue.
Thank you,
Zach
Hello Zach,
You can check this post – https://butenko.pro/2019/12/23/xrm-navigation-navigateto-gotchas-tricks-and-limitations/
If you’re familiar with Fluent UI/React you can check the following posts as well:
https://butenko.pro/2020/04/22/development-of-custom-html-js-webresources-with-help-of-modern-frameworks/
https://butenko.pro/2022/01/17/lets-build-html-webresources-faster-and-smarter/
Andrew