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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to trigger Javascript in Grid Refreshing?

(0) ShareShare
ReportReport
Posted on by 1,000

I create one javascript function For calculate the No.Of Days from created Date and show in one Field.

And I add that script in Form Load and as well Form Save Actions.It was Working Fine.

Now My question is,I need to trigger that javascript function grid's(view) refresh.Or I need to calculate and show the No Of Days Field without opening Form.

Now the noofdays field affected when the form will getting open.

I need noofdays field automatically updated From the Created on date?How to do this...Thanks in Advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    Typically elapsed time fields are not stored in the database because they need to be recalculated on the fly. If you want to have this value in a sub grid then the only way I can think of doing this in a supported way is to add a Retrieve multiple plugin and loop through the results and add the calculation. An example of this technique can be found in my sample at code.msdn.microsoft.com/.../Multi-Language-Lookups-in-18fadc80

    Hope this helps.

    Scott

  • Soma Shekar Profile Picture
    461 on at

    Hi

    You need to write a plugin/workflow

    so it will be triggered on some event , so your data will be calculated and will show on the form

    If you tries to refresh the button event , it will be unsupported way ,

    Thanks

    Soma

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi,

    I think you should create a batch scheduled job that running for at least every 1 day since you want to count No of Days.

    Another Alternative, if you are using CRM 2013 SP1 or Online Springwave update, is using CRM Timer in the form. This is only work in the form.

    This is actually was designed to show how long the delay is counted from expected date, for example, neglected case, cases that are supposed to be first responded by 1 July 2014, but until now still no response, you can set the timer by a datetime field. SO can count this case has been neglected or not yet resolved for how many days, even can be how many second.

    And you might be setup the 'tricky rules' for Success, Warning, and Cancelled condition. (try to setup never ending rules, if you want to always show.

    This is the example:

  • Suggested answer
    Royal King Profile Picture
    27,686 on at

    you can write a job that updates this field value on nightly basics this way you dont have to worry about anything.

  • Suggested answer
    SONU Profile Picture
    193 on at

    Hi Vijay,

    In order to trigger a javascript function on change of subgrid(on associate or disassociate) you can use the following code

    Xrm.Page.getControl("subGridName").addOnLoad(FunctionNameToBeCalled);
    Xrm.Page.getControl("subGridName").refresh();

    add this piece of code on load of the form.

    it will make your work done.

    Thanks

    Nidheesh CP

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans