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 365 | Integration, Dataverse...
Suggested Answer

Update field for multiple selected items using button on the ribbon

(0) ShareShare
ReportReport
Posted on by 803

Is it possible to do with a single javascript function? I am just wanting to update a boolean field. Basically, we will click a button in the ribbon from the grid and the field will toggle and the grid will refresh. Does any have a thought on the best way to get started or samples of code for a similar operation? Thank you. 

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Ben,

    You can pass selected items to the function from the ribbon - ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

    To update the record you can use Xrm.WebApi.updateRecord.

  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Ben,

     

    You can try to use other better ways to update the field for multiple selected items, which do not need any code and seems more simple than JS.

    1.Bulk Edit Feature

    This is ideal for those quick modifications to a smaller number of records.

    (1) select records that you need modify and click edit button.

    14830.png

    (2) A Bulk Edit form appears.

    140650.png

    (3) update field to data that you need and click Change button, you will see following:

    80582.png

    2.Flow.

    For a number of records, you can try to use flow to achieve goal.

    (1) expand Flow to create a flow.

    22780.png

    (2) add ‘update a record’ action and set the two options field value to ‘Yes’.

    406008.png

    (3) Click Save button.

    (4) Test.

    Refresh page and Select records and Expand flow to run the flow that just created.

    371031.png

    You will see following after refresh page:

    0116.png

    Best Regards,

    Leo

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    check below article on how to refresh subgrid once you done updating the boolean field.

    carldesouza.com/.../

    docs.microsoft.com/.../refresh

    Please Mark My Answer Verified If I Were Helpful

  • urklnme Profile Picture
    439 on at

    I am missing someting here....

    From a Ribbon button can I pass the CRM parameter selectedcontrolselecteditemsreferences and the execution context?

    I mean how do I get the gridcontext?  

  • XM-22040801-0 Profile Picture
    11 on at

    Hi urklnme

    In a sub-grid, the selectedcontrol is the grid context.

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 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 47 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans