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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 12

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

I have the same question (0)
  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

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

  • Community Member Profile Picture
    on at

    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");

    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans