Skip to main content
Microsoft logo
Power Apps
    • AI Builder
    • Automate processes
    • Azure + Power Apps
    • Build apps
    • Connect data
    • Portals
  • Pricing
    • Overview
    • Become a Partner
    • Find a Partner
    • Find partner offers
    • Partner GTM Resources
    • Blog
    • Customer stories
    • Developer Plan
    • Documentation
    • For IT Leaders
    • Roadmap
    • Self-paced learning
    • Webinars
    • App development topics
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • User groups
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Power Apps Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power Apps
    • Building Power Apps
    • Microsoft Dataverse
    • AI Builder
    • Power Apps Governance and Administering
    • Power Apps Pro Dev & ISV
    • Power Apps Portals
    • Connector Development
    • Power Query
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Community Blog
    • Power Apps Community Blog
    • Galleries
    • Community Connections & How-To Videos
    • Community App Samples
    • Webinars and Video Gallery
    • Canvas Apps Components Samples
    • Kid Zone
    • Business Value Webinars and Video Gallery
    • Emergency Response Gallery
    • Events
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Ideas
    • Power Apps Ideas
    • Community Engagement
    • Demo Extravaganza 2021
    • Demo Extravaganza - Components 2021
    • Power Apps Community Demo Extravaganza 2020
    • Experimental
    • Error Handling
    • Power Apps Experimental Features
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Power Apps Community
    • Galleries
    • Webinars and Video Gallery
    • Back to Basics # 61: Usage of async and await with...

    Back to Basics # 61: Usage of async and await with Webresource in Dynamics CRM[Telugu]

    06-29-2022 11:30 AM

    codevenkat
    Post Prodigy
    95 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    codevenkat
    codevenkat Post Prodigy
    Post Prodigy
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    Back to Basics # 61: Usage of async and await with Webresource in Dynamics CRM[Telugu]

    ‎06-29-2022 11:30 AM

    Await / Async is built on promises and is a clean way to represent asynchronous processes in a synchronous way. In Dynamics 365 async and await are used especially while working with web api calls so that until promise gets completed other part of the code will not get executed. As an example, on selected contact record this behaviour was shown .

     

    English version of Blog :
    https://venkatasubbaraopolisetty.com/2022/06/29/back-to-basics-61-usage-of-async-and-await-with-webr...

     

    Thanks for watching. You can find me in the following places:
    🎯 Website: https://venkatasubbaraopolisetty.com/

    🎯 Twitter: https://twitter.com/Venkata48681009

    🎯 LinkedIn: https://www.linkedin.com/in/venkata-subbarao-polisetty-mvp-mct-54116618/

    watch?v=28omPKIjMwU

    Labels:
    • Labels:
    • Common Data Service
    • Dataverse
    • Pro Developer Topics
    Message 1 of 4
    95 Views
    0 Kudos
    Reply
    • All posts
    • Previous Topic
    • Next Topic
    Ajithnair621
    Ajithnair621 Advocate II
    Advocate II
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎07-06-2022 10:05 AM

    I have written a simple code to test ASYNC and AWAIT on my PowerApps environment. It is as seen in below code. Display function has been placed onSave of Form.

    Unfortunately when i execute below code system does not stop saving the record.
    I have referred following links too. 
    https://debajmecrm.com/are-you-using-async-functions-in-your-webresources-yet-in-dynamics-365-they-c...
    https://debajmecrm.com/how-to-make-xrm-webapi-calls-synchronous-in-dynamics-365-cds/
    https://debajmecrm.com/async-onsave-handlers-in-dataverse-dynamics-365-forms-to-cancel-save-operatio...

    var synchandling = window.synchandling || {};
    (
        function () {
            "use strict";
            this.displaySynchronousConfirmationDialogBox = async function (executionContext, displayConfirmationMessage) {
                var formContext = executionContext.getFormContext();
                var formSaveEvent = executionContext.getEventArgs();
                var confirmStrings = {
                    text: displayConfirmationMessage,
                    title: "CONFIRMATION"
                };
                var confirmOptions = {
                    height: 200,
                    width: 250
                };

                let userResponse = await Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
                    function (success) {
                        if (!success.confirmed) {
                            if (formSaveEvent)
                                formSaveEvent.preventDefault();
                            return true;
                        }
                        else
                            return false;
                    }
                );
                return userResponse;
            }
        }
    ).call(synchandling);
    Message 2 of 4
    38 Views
    0 Kudos
    Reply
    codevenkat
    codevenkat Post Prodigy
    Post Prodigy
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎07-12-2022 09:48 AM

    Try to use delay functionality with  setTimeout() function 

    Message 3 of 4
    25 Views
    0 Kudos
    Reply
    Ajithnair621
    Ajithnair621 Advocate II
    Advocate II
    In response to codevenkat
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎07-12-2022 09:51 AM

    They delay too can be set for a maximum of 10 seconds as I understood from some community posts.

    Message 4 of 4
    23 Views
    0 Kudos
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Automate
    • Power Virtual Agents

    Power Apps

    • Sign in
    • Sign up

    Browse

    • Sample apps
    • Services

    Downloads

    • Windows
    • iOS
    • Android

    Learn

    • Documentation
    • Support
    • Community
    • Give feedback
    • Blog
    • Partners

    • © 2022 Microsoft
    • Follow Power Apps
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks