We have integrated our phone system with D365 and it automatically creates a phone call activity. I would like to disable the Phone Call Quick Create Form. How would I do that? Thanks!
We have integrated our phone system with D365 and it automatically creates a phone call activity. I would like to disable the Phone Call Quick Create Form. How would I do that? Thanks!
Hi Wahaj Rashid
All your remaining code works fine. except when it performs formContext.ui.close(). it prompts whether we want to save changes before the window closes.
I have attached the Screenshot as well.
This is the documentation URL of formContext.ui.close()
I want to overcome this prompt with the help of JavaScript code or through any sort of API .
Thanks
Hi Wahaj,
The script you provided in your blog worked successfully for our Dynamics 365 instance. However, recently, this is no longer working. We have tried to recreate the web resource but it will no longer close the quick create form
Do you know of any updates required to get this script working again?
Thanks,
Paul
Hello Wahaj, I tried to implement your solution, but when clicking the phone button, I receive an error. Is there any other way to disable it? Thanks
Thank you Wahaj! I will try this!
Hi,
I found a solution, it's a bit of a hack but works.
So we know, we cannot stop launching the Phone Quick Create form, however, we can force close it when launched from Click-to-Call.
Luckily, a query string parameter is passed named contactinfo which starts with 'tel:<phone number'.
Now, all we have to do is register an onLoad function on the Phone Quick Create to close the form when launched using Click-to-Call.
Here is the code:
function phOnLoad(executionConext) { var formContext = executionConext.getFormContext(); var formType = formContext.ui.getFormType(); if (formType != 1) { // If not Create, optional check as form is Quick Create return; } var params = Xrm.Utility.getGlobalContext().getQueryStringParameters(); var contactinfo = params.contactinfo; if (contactinfo != null && contactinfo != undefined && contactinfo.startsWith("tel:")) { // If Form is opened from TEL protocol, close the form forcefully. formContext.ui.close(); } }
Please see my blogpost for detailed steps and explanation:
https://crmlogs.wordpress.com/2021/02/09/dynamics-365-ce-click-to-call-prevent-phone-quick-create/
It's not that elegant, but works.
Hi,
As far as I know, you cannot stop this new phone form.
Here is a similar thread:
Hello Wahaj,
Risking being wrong by making an assumption, I think you misunderstand. I seem to have the same problem, namely the automatic creation when the Click to Call button is pressed. For me, I would like to click on the button to start our phone system with the number in CRM, but stay on the form on which the field is ( so no quick create form, or switch to a main form of the Telephone table/entity).
Can you, or anybody help with this problem?
Kind regards,
Peter
Hi,
Thank you for your query.
Depending on your need, you can opt one of these approaches:
1 - You can set the Phone Call as read-only in the Entity Configuration. However, this way user can't create or edit the phone call (they can only see it in read-only mode).
Here are steps to follow:
I guess, phone calls will be already completed in your scenario, hence users do not need to edit the Phone Call records.
If you still think, they should edit:
2 - Add a script on the Phone Call form to make it read-only (as suggested by Clofly) when form type is Create.
3 - Or you can create a real-time workflow to prevent Phone Call creation. If your phone call records are create by a specific user (integration user), you can add a condition to stop creation if the user is not integration user.
For example:
Hi DawnK,
Please check whether the solution would work for you:
Firstly we still need to disable the quick creation feature of phone call.
Then, due to form has different types, so we can run custom javascript function at OnLoad event of Phone Call form to lock all fields when the form type is "Create":
function disableCreate(executionContext) { var formContext = executionContext.getFormContext(); var formType = formContext.ui.getFormType(); if (formType === 1) { formContext.ui.controls.forEach(function (control, index) { var controlType = control.getControlType(); if (controlType != "iframe" && controlType != "webresource" && controlType != "subgrid") { control.setDisabled(true); } }); var confirmStrings = { text: "Phone call creation is disabled.", title: "Confirmation Dialog" }; var confirmOptions = { width: 450, height: 200 }; Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then( function (success) { if (success.confirmed) console.log(""); else console.log(""); }); } }
e.g: After clicking the phone icon, user will navigate to phone call form, but with the code, it will show a confirmation dialog.
All fields will be locked even if we close the dialog.
In addition, from my test, it seems that we can still save form even if all fields are locked and required field such as subject is blank, so please register another function at OnSave event of the form to prevent saving event.
function stopSave(executionContext) { var formContext = executionContext.getFormContext(); var formType = formContext.ui.getFormType(); if (formType === 1) { var subject = formContext.getAttribute("subject").getValue(); if (subject === null) { var eventArgs = executionContext.getEventArgs(); eventArgs.preventDefault(); var confirmStrings = { text: "You can't save phone call with empty subject.", title: "Confirmation Dialog" }; var confirmOptions = { width: 450, height: 200 }; Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then( function (success) { if (success.confirmed) console.log(""); else console.log(""); }); } } }
Regards,
Clofly
Thanks but I do not want any Phone Call form to open because the integration automatically
creates a phone activity.
I am looking for the way to stop the phone call form to open when I click on the phone icon.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156