Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics 2016 - 1. how to clear Form Parameters? 2. How to pass notification on new form?

Posted on by 10

Hi,

I have some problems with notifications. I call some custom action from JS, in .NET I pass ERROR communicate, that must be displayed in new opened form. When I get 200 response, then I display my ERROR on current form (notification bar), then store it in actual form's parameter and call function .Xrm.Utility.openEntityForm(entity, id, ERRORparameter). Called function is opening my entity in new form. In javaScript OnLoad function, I read the error from form's parameter and display it on notificiation bar.

Everything perfect so far.. :)

Problem begins, when user try to refresh the form (f5), error still appears. They are stored in querystring (context.getQueryStringParameters() is the way I read them) and onLoad I read them. Question, how to clean up parameters from form? 

Maybe someone knows better way, how to open new form and pass some information in other way than form's parameter?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics 2016 - 1. how to clear Form Parameters? 2. How to pass notification on new form?

    Hi Markos,

    Please try below code on formLoad function:

       var recordId = Xrm.Page.data.entity.getId();

       if (recordId.indexOf("{") > -1) {

           recordId = recordId..replace("}","");

    recordId = recordId..replace("{","");

       }

       if (recordId != null && recordId != "" && recordId != "undefined") {

       }else{

    var notificationMessage = "Your message";

           Xrm.Page.ui.setFormNotification(notificationMessage , "ERROR");

    }

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Dynamics 2016 - 1. how to clear Form Parameters? 2. How to pass notification on new form?

    This is expected. Unless you got the needed querystring param for the purpose & redirect the user to a new page without querystring.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans