Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

form notification is not refreshed when it is called through TabStateChange event

(1) ShareShare
ReportReport
Posted on by 34
Hi,
 I am using form control on an application form that includes two tabs: Technical and Business.
Each tab uses form control to display its respective data. I need to display different messages to the user based on the status of the form: If the status is Draft, the message should read: “Update Status Reason to Complete to lock the record and submit for review.” If the status is Complete, the message should read: “Update Status Reason to Draft to unlock the record for modifications.” 
 
I called a function on the OnChange event of the status field on both the Technical and Business forms, and the notification message was displayed correctly.
However, when I called the same function on the TabStateChange event for the Technical and Business tabs on the application form, the message did not refresh.
I suspect the issue may be related to refreshing the form used in the form control.

I attempted to resolve this by trying another function (as suggested in the second blog), but the message still does not refresh when the TabStateChange event occurs.
Could you please advise on how to ensure the message refreshes correctly when the TabStateChange event is triggered? Thank you, Siva
 
 function throwCustomMessage(statuscodeControl, statusReason) { 
var customStatusChangeMessage = “customStatusChangeMessage”; 

let ifComplete = parent.Xrm.Utility.getResourceString(“apms_resx/messages”, “IfComplete_CustomMessage”); 
let ifDraft = parent.Xrm.Utility.getResourceString(“apms_resx/messages”, “IfDraft_CustomMessage”); 
 
if (statusReason == 1 && statuscodeControl != null && !statuscodeControl.getDisabled()) {
Xrm.Page.ui.setFormNotification(ifDraft, “INFO”, customStatusChangeMessage);
 
} else if (statusReason != 1 && statuscodeControl != null && !statuscodeControl.getDisabled()) {
Xrm.Page.ui.setFormNotification(ifComplete, “INFO”, customStatusChangeMessage);
 
} else { Xrm.Page.ui.clearFormNotification(customStatusChangeMessage); }

Second block: 
if (statusReason == 1 && statuscodeControl != null && !statuscodeControl.getDisabled()) {
formContext.getControl(entityName).ui.setFormNotification(ifDraft, “INFO”, customStatusChangeMessage); } 
else if (statusReason != 1 && statuscodeControl != null && !statuscodeControl.getDisabled()) {
formContext.getControl(entityName).ui.setFormNotification(ifComplete, “INFO”, customStatusChangeMessage); } 
else { formContext.getControl(entityName).ui.clearFormNotification(customStatusChangeMessage);
}
 
 

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans