Skip to main content

Notifications

Announcements

No record found.

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

Web resource not working in live and working fine in sandbox

Posted on by 90

Hii everyone,

I have created a web resource that will just set a static value in a field and my code is working fine on the sandbox but the code is not working in the live, code is running properly but not  giving the desired output.can anyonre help me  why this issue is coming.

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: Web resource not working in live and working fine in sandbox

    Hi himanshu rawat,

    Use the below code and share the results:

    function UpdateData(executionContext) {
    try {
    alert("message for debugging");
    var formContext = executionContext.getFormContext();

    if (formContext.ui.getFormType() == 1) {
    alert("message for debugging 1");
    formContext.getAttribute("new_description").setValue("[Vorname Nachname Kunde] Terminart – Thema (Detailbeschreibung)");
    alert("message for debugging 2");
    }
    } catch (e) {
    alert("Error: " + e.message + ".");
    }
    }

  • himanshu rawat Profile Picture
    himanshu rawat 90 on at
    RE: Web resource not working in live and working fine in sandbox

    Below is my code :

    function UpdateData(executionContext)

    {

    debugger;

    var formContext = executionContext.getFormContext();  

    if(formContext.ui.getFormType() == 1)

    {

    formContext.getAttribute("new_description").setValue("[Vorname Nachname Kunde] Terminart – Thema (Detailbeschreibung)");

    }

    }

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Web resource not working in live and working fine in sandbox

    Hi,

    Have you  tried debugging on your live instance by opening the developer tool (F12) in browser?

    Have you added console logs in your which can be check from the same browser developer tool?

    Please share your code to check further.

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: Web resource not working in live and working fine in sandbox

    Hi himanshu rawat,

    Is there any static value you might need to change? It is better to share code.

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans