Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

setNotification in subgrid field change by js

(1) ShareShare
ReportReport
Posted on by 340

Hi Everyone,

I want to set notification on the change of subgrid field value calling below code but when changing values from subgrid cell nothings happens ?

function OnChange_telephone(executionContext)
{
//debugger;
var formContext = executionContext.getFormContext();
var mobile=formContext.getAttribute("telephone1").getValue();
//var mobile=formContext.getAttribute("telephone1").getValue();
if(isNaN(mobile)) {
formContext.getControl("telephone1").setNotification("incorrect Format","101");
}
else
{
formContext.getControl("telephone1").clearNotification("101");
}
}


Please advise if there is other syntax to setNotification  on subgrid field?

Regards, Alok

Categories:
  • Suggested answer
    Antonio Lamanna Profile Picture
    Antonio Lamanna 165 on at
    RE: setNotification in subgrid field change by js

    Try also this www.inogic.com/.../identify-the-trigger-for-an-on-load-event-for-sub-grid-in-dynamics-crm

  • Alok Sharma Profile Picture
    Alok Sharma 340 on at
    RE: setNotification in subgrid field change by js

    Hi Kokulan,

    I'm calling this function onchange of the field in the grid.

  • Alok Sharma Profile Picture
    Alok Sharma 340 on at
    RE: setNotification in subgrid field change by js

    Hi Antonio,

    I'm trying to set notification on field so will that be fine if add my code like

    if(your_condition){
        formContext.ui.setNotification(message,uniqueId);
    } else {
        formContext.ui.clearNotification(uniqueId);
    }


    If yes , then also it didn't work

  • Suggested answer
    Antonio Lamanna Profile Picture
    Antonio Lamanna 165 on at
    RE: setNotification in subgrid field change by js

    In any case, you should do something like this:

    if(your_condition){
        formContext.ui.setFormNotification(message, level, uniqueId);
    } else {
        formContext.ui.clearFormNotification(uniqueId);
    }

    and set the condition well.

    formContext.ui.setFormNotification (message, level, uniqueId);

  • Kokulan Profile Picture
    Kokulan 18,050 on at
    RE: setNotification in subgrid field change by js

    Hi Alok

    Could you please share more details on how you are binding the OnChange_telephone function to Subgrid value change?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans