web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Web resource method does not exist

(0) ShareShare
ReportReport
Posted on by 62

I have written Dynamics CRM JScript code to populate fields based on previous input, but while running the script I am getting error as "Web resource method does not exist".

**My code: -**

var B_line = window.B_line || {};
(function() {

this.formOnLoad = function(executionContext) {
const formContext = executionContext.getFormContext();
const businessarea = formContext.getAttribute("new_buniessarea21").getText();
const businessline = formContext.getControl("new_businessline21");
function Options() {
businessline.clearOptions();
for (var i = 0; i < arr.length; i++) {
businessline.addOption({
value: arr[i].value,
text: arr[i].text
});
}
}
```
}).call(B_line)

I using this command B_line.formOnLoad to call the function OnChange of the event.

Showing error as "Web resource method does not exist"

Can anyone help me out?

Error image

pastedimage1672396958193v1.png

I have the same question (0)
  • Suggested answer
    Tamilarasu Arunachalam Profile Picture
    587 on at
    RE: Web resource method does not exist

    Hi Rajath,

        Please check your event, library and function name is entered correctly in handler properties

    pastedimage1672399800422v1.png

    If you found this helpful, like or verify my answer

  • Rajath Krishna S Profile Picture
    62 on at
    RE: Web resource method does not exist

    I have entered it correctly

    Pls check

    pastedimage1672400475237v1.png

  • Suggested answer
    Ganesh Chowhan Profile Picture
    160 on at
    RE: Web resource method does not exist

    Hi there,

    I believe there is something need to re-check around script namespace declarations.

    Following code works perfectly. Please try this.

    if (typeof (B_line) === "undefined")

    { B_line = {}; }

    B_line.formOnLoad = function(executionContext) {

    const formContext = executionContext.getFormContext();

    Xrm.Utility.alertDialog("testing script success")

    }

    Also I see in your scrip there is arr.length n loop, where are you getting the arr variable?

    If any other issues try to debug in browser pressing F12 and adding debugger; at the beginning of the code. 

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Web resource method does not exist

    Hi,

    Please check syntax issue on below tool

    esprima.org/.../validate.html

  • Deepan Raj Profile Picture
    25 on at
    RE: Web resource method does not exist

    Hi 

    Please use this code that i modified 

    function var B_line(executionContext) {
    debugger;

    const formContext = executionContext.getFormContext();
    const businessarea = formContext.getAttribute("new_buniessarea21").getText();
    const businessline = formContext.getControl("new_businessline21");
    function Options() {
    businessline.clearOptions();
    for (var i = 0; i < arr.length; i++) {
    businessline.addOption({
    value: arr[i].value,
    text: arr[i].text
    });
    }
    }
    }

    -->Main issue is you didn't close the function 

    call the function name as var B_line in form onload step in form properties 

    Please Rply if you find this useful

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

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 117 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 110

#3
#ManoVerse Profile Picture

#ManoVerse 56

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans