Wednesday 27 February 2019

Alert and Confirm syntax will not work for Dynamics 365 App For Outlook

Recently, I just helped customer to upgrade their system to 9.1.x.x
We encountered many issues. However, the issue that I want to bring up now is issue regarding to the App for Outlook

We found that there is custom ribbon that calls Custom Javascript and it does nothing, no error, nothing is so-called exception occurred because I did debugging and did place the try catch block.
Unlike using Web, the debugging in Outlook is not so easy.
After I did debugging with try catch, I found out that the script is actually running well and has no error.

So, the problem is: the script that is executed is pretty simple just do some validation and show alert when does not fulfill, then throw a confirmation dialog then save the form.
Yes, the script is sucessfully executed from start to the end.

Then, why the ribbon function is not running?



It is because the alert and confirm scripts are still using old ways:

alert("Please complete all mandatory fields before submitting the form")
if (!confirm("Are you sure that you want to submit this form??")) {
            return;


So, there is no error it is just not 'supported' and not 'translated' well in the App for Outlook.
yes, it does working in Web, but not in App for Outlook.

So, after I changed it to

 Xrm.Utility.alertDialog("Please complete all mandatory fields before submitting the form");
or
    var alertStrings = { confirmButtonLabel: "OK", text: "Please complete all mandatory fields before submitting the form" };
    var alertOptions = { height: 100, width: 500 };
    Xrm.Navigation.openAlertDialog(alertStrings, alertOptions);

and

if (!Xrm.Utility.confirmDialog("Are you sure that you want to submit this form??")) {
            return;
        }

It is working perfectly!
Example:








**The first one is still supported and it is intended for simple alert.
Xrm.Utility namespace may be obsolete for the Alert and Confirm Dialog, so as per MSDN recommendation, we need to change it :
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openalertdialog

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openconfirmdialog

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-utility

Hope it helps!

Thanks




24 comments:

  1. Excellent blog information provided by the author
    Best Play and Pre School for kids in Hyderabad,India. To give your kid a best environment and learning it is the right way to join in play and pre school were kids can build there physically, emotionally and mentally skills developed. We provide programs to kids like Play Group, Nursery, Sanjary Junior, Sanjary Senior and Teacher training Program.
    ­play school in hyderabad

    ReplyDelete
  2. Perbedaannya adalah pada permainan Bandar Sakong, masing-masing bettor mendapatkan 3 kartu remi. Permainan sakong terdiri dari 8 bettor yaitu 1 orang jadi bandar dan 7 lainnya adalah bettor
    asikqq
    dewaqq
    sumoqq
    interqq
    pionpoker
    bandar ceme
    hobiqq
    paito warna terlengkap
    Syair HK

    ReplyDelete
  3. Good explanation of the topic

    Sanjary Academy is the best Piping Design institute in Hyderabad, Telangana. It is the best Piping design Course in India and we have offer professional Engineering Courses like Piping design Course, QA/QC Course, document controller course, Pressure Vessel Design Course, Welding Inspector Course, Quality Management Course and Safety Officer Course.
    Piping Design Course in Hyderabad ­

    ReplyDelete
  4. Excellent product by Microsoft.Thanks for sharing Surya Informatics

    ReplyDelete
  5. Thanks for posting the information it is useful and helpful

    Pressure Vessel Design Course is one of the courses offered by Sanjary Academy in Hyderabad. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course,Welding Inspector Course, Quality Management Course, #Safety officer course.
    Welding Inspector Course
    Safety officer course
    Quality Management Course
    Quality Management Course in India

    ReplyDelete
  6. This is really a very good blog and thanks for sharing it with the community!Keep Posting Many Blogs Like this.
    crm software development company in chennai

    ReplyDelete
  7. Nice information on here, I would like to share with you all my experience trying to get a loan to expand my Clothing Business here in Malaysia. It was really hard on my business going down due to my little short time illness then when I got heal I needed a fund to set it up again for me to begin so I came across Mr Benjamin a loan consultant officer at Le_Meridian Funding Service He asked me of my business project and I told him i already owned One and i just needed loan of 200,000.00 USD he gave me form to fill and I did also he asked me of my Valid ID in few days They did the transfer and my loan was granted. I really want to appreciate there effort also try to get this to anyone looking for business loan or other financial issues to Contact Le_Meridian Funding Service On Email: lfdsloans@lemeridianfds.com / lfdsloans@outlook.com He also available on WhatsApp Contact:+1-9893943740.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. It was a great information and Its really worth reading it.
    MS Dynamics Trade and Logistics Online Training

    ReplyDelete
  10. Intelepos takes pride in offering efficient Epos system for takeaway to keep your business at the top of the competition. This system easily manages your staff, menu, clients, and sales during peak business hours. Our professional team brings innovation to cover all aspects of your business. To increase your customer base and profits contact us today.
    EPOS System for Takeaways
    EPOS System in UK
    EPOS System Lonodn
    EPOS System Nottingham

    ReplyDelete
  11. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again.
    ALL University BCOM 1st, 2nd & Final Year TimeTable 2020

    ReplyDelete
  12. I really enjoyed your blog Thanks for sharing such an informative post.

    Microsoft Dynamics 365 Services

    ReplyDelete
  13. IIS India is your premier destination for top-tier web solutions. With a skilled team, we excel in web design, development, and digital marketing services. Our commitment to innovation and client success sets us apart.

    ReplyDelete
  14. IIS INDIA is a leading website designing that creates captivating digital experiences. We reinvent online presence with fluid functionality, creative design, and customised solutionswebsite designing company in delhi Our proficiency encompasses a wide range of sectors, producing memorable websites. With IIS INDIA, where innovation and state-of-the-art technology collide,

    ReplyDelete
  15. IIS INDIA: Premier Website Designing Company in Delhi. Elevate your online presence with our expert team of designers. From sleek layouts to user-friendly interfaces,website designing company in delhiwe craft websites that captivate and convert. Experience top-notch service and cutting-edge designs. Let's bring your digital vision to life

    ReplyDelete

My Name is..