Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics CRM 2015 (Update 0.3) - OnPremises - Refresh data after notes(annotation) upload

Posted on by 70

Hello All,

I have a custom entity on which "notes with attachments" is activated.
I'm able to create the custom entity and save it.
Once the custom entity is  saved I'm adding a note with attachment and the note is created sucessfully.
I'm doing certain custom actions in the plugin "OnPostCreateNote" and I'm updating certain fields of the custom entity.

I want to refresh the data on the custom entity form to reflect the fields that were modified in the plugin.
Whats the best way to do it?

Awaiting your valuable inputs.

Regards,
Clement



*This post is locked for comments

  • Clement-ALBERT Profile Picture
    Clement-ALBERT 70 on at
    RE: Dynamics CRM 2015 (Update 0.3) - OnPremises - Refresh data after notes(annotation) upload

    This is the script bit i implemented.

     modifiedOn_onChange: function () {
            debugger;
            try {            
                if (Xrm.Page.getAttribute(Bdf.Document.Attributs.modifiedOn) != null) {
                    Xrm.Page.data.setFormDirty(false);
                    var Id = Xrm.Page.data.entity.getId();
                    if (Id != "")
                    {
                        Xrm.Utility.openEntityForm(Bdf.Document.Attributs.entiteDocument, Id);
                    }
                }
    
            }
            catch (e) {
                Xrm.Utility.alertDialog(e.message);
            }
        }

    The modifiedOn_onChange is successfully called when the fields of the main entity changes.
    But its not happening in the case when the NOTE is added.
    I verfied in the DB that adding Note to the custom entity changes the "modifiedOn" field value.
    What am I missing?

  • Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Dynamics CRM 2015 (Update 0.3) - OnPremises - Refresh data after notes(annotation) upload

    In addition of Ravi's reply:

    Please make sure that Modified on field of custom entity get updated when you add Notes. If not then form will not refresh.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Dynamics CRM 2015 (Update 0.3) - OnPremises - Refresh data after notes(annotation) upload

    Hi,

    To refresh the form you can use openEntityForm script (details below) but because adding a note doesn't trigger any event, there is now place to add this script to trigger. The best option you have is to have which counts the number of notes on first load then then continuously does the same counting and check with the previous count, if the count changes then call the refresh script.

    dynamicsofdynamicscrm.com/.../scripting-tip-refresh-form-on-save-in-crm-20152016

    Hope this helps.

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans