Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Web Resource method does not exist

(1) ShareShare
ReportReport
Posted on by

I am getting the below error: 

 
 
  • Suggested answer
    Joseph Melillo Profile Picture
    Joseph Melillo 114 on at
    Web Resource method does not exist
    It seems your function name is incorrect.
    The function name in your script file does not match the one configured in the form event handler.
     
     
    Also you can use the following function that is improved version:
     
    function checkForDuplicates(executionContext) {
        var formContext = executionContext.getFormContext();
        formContext.data.refresh(false).then(function success() {
            var duplicateFlag = formContext.getAttribute("eem_ContractDupeFlag3").getValue();
            if (duplicateFlag === true || duplicateFlag === 1) {
                var alertStrings = {
                    confirmButtonLabel: "OK",
                    text: "A record with the same combination of fields already exists.",
                    title: "Duplicate Warning"
                };
    
                var alertOptions = { height: 120, width: 260 };
                Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
                    function success() {
                        console.log("Alert closed");
                    },
                    function error() {
                        console.error("Error showing alert dialog");
                    }
                );
            }
        }, function error(err) {
            console.error("Error refreshing data: ", err.message);
        });
    }
    
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,308 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,320 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans