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

Announcements

News and Announcements icon
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,086 Moderator on at

    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

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

  • Guido Preite Profile Picture
    54,086 Moderator on at

    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

    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,995 Moderator on at

    Hi,

    Check if your javascript code syntax is correct.

    esprima.org/.../validate.html

  • Suggested answer
    kaih Profile Picture
    Microsoft Employee on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 49 Super User 2026 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 48 Super User 2026 Season 2

#3
Subra Profile Picture

Subra 42 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans