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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Web Resource Method does not exist

(0) ShareShare
ReportReport
Posted on by 36

I am trying to create an on change event handler js but getting the error "Web resource method does not exist".

Here is my script:

function AdvanceToStep2(executionContext) {
var formContext = executionContext.getFormContext();

var Created= "0fe096ff-262a-4480-b555-89e7751cb892";
var Step1= "0f7e76b9-fd0c-41a8-a4ef-86bd4d61535b";
var Step2= "19d9bf90-b6fd-49ca-8340-3f9b6ad8befa";


var entity = {};
entity["activestageid@odata.bind"] = "/processstages(" + Step 1+ ")";
entity["traversedpath"] = Created+ "," + Step1+ "," + Step2;

var BPFId = "2d2ed6fa-6dfd-ec11-82f6-0022481b1886";

var req = new XMLHttpRequest();
req.open("PATCH", Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/raf_financebpfs(" + BPFId +
")", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;

if (this.status === 204) {
alert("Success");
} else {
alert("Error");
}
}
};
req.send(JSON.stringify(entity));
}

and the error message: 

Web resource method does not exist: AdvanceToStep2
Session Id: x
Correlation Id: x
Event Name: onchange
Function Name: AdvanceToStep2
Web Resource Name: raf_AdvanceToStep2
Solution Name: Active
Publisher Name: x
Time: Mon Jul 18 2022 11:29:10 GMT+0100 (British Summer Time)

I have the same question (0)
  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Web Resource Method does not exist

    the content is not relevant in this error. check if you connected the right library to the event handler and try to publish again

  • HK Profile Picture
    36 on at
    RE: Web Resource Method does not exist

    I am unfortunately new to this, how do I ensure I am connected to the correct library?

  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Web Resource Method does not exist

    in the window where you attached the event you need to choose a js file, are you sure you selected the js file where this method called AdvanceToStep2 is present? maybe you select another js file, and make sure you publish the js file and the form.

    sorry but without having access to your system that is the only thing comes to mind that can generate the error you mentioned.

  • HK Profile Picture
    36 on at
    RE: Web Resource Method does not exist

    Thanks, that makes sense.

    Well it's the only .js I have created so I am certain it is the right one. I will ensure both are published properly!

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

    Hi,

    Check if your javascript code syntax is correct.

    esprima.org/.../validate.html

  • Suggested answer
    kaih Profile Picture
    on at
    RE: Web Resource Method does not exist

    Hello,

    There is an extra space between Step and 1:

    >entity["activestageid@odata.bind"] = "/processstages(" + Step 1+ ")";

    You can use below link to check your javascript code syntax:

    esprima.org/.../validate.html

  • HK Profile Picture
    36 on at
    RE: Web Resource Method does not exist

    It was a syntax error! Thankyou! 

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 85 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 57 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans