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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

add move up/down arrows to custom view

(2) ShareShare
ReportReport
Posted on by 3,299
Hi All
I want to add move up/down arrows to a custom view in quote products. The below is standard quote product inline edit view and we cannot add new fields to it so created a new view however move lines options is not there. If we cannot add new columns to default view is there a way to create javascript function customisation to achieve same. The goal is the change the sequence numbers and print document in a given sequence
I have the same question (0)
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,360 Moderator on at

    Yes, in Dynamics 365 Sales, you can achieve this by:

    1. JavaScript Customization – Add a custom JavaScript function to update the sequence field and refresh the view.
    2. Custom Ribbon Button – Use a Power Automate Flow or JavaScript to update line item positions when clicking up/down.
    3. Editable Grid with Custom Actions – Implement a custom PCF control to allow reordering within the grid.
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,841 Moderator on at
    Hello Samantha,
     
    You're right, the standard inline edit view for Quote Products has limitations. You can't directly add new fields or reorder lines using built-in features. However, you can achieve the move up/down functionality using a JavaScript customization.
     

    Here's a breakdown of how to implement this:

    1. Create a Custom View:

    • As you've already done, create a custom view for Quote Products. This will be the view where you add the move up/down functionality.

    •  

    2. Add "Move Up" and "Move Down" Buttons:

    • Custom Buttons: Add two custom buttons to the command bar of your custom view:

      • "Move Up"

      • "Move Down" 

    • JavaScript Functions: Associate each button with a JavaScript function that will handle the reordering logic.

    •  

    3. Develop the JavaScript Functions:

    • Get Selected Row:

      • Use the gridContext (passed to the function by Dynamics 365) to get the selected row in the view 

    • Get All Rows:

      • Use the gridContext to get all rows in the view 

    • Get Sequence Number:

      • You'll need a field to store the sequence number (e.g., a custom "Line Order" or "Sequence Number" field as discussed previously).

      • Retrieve the sequence number of the selected row and the adjacent row 

    • Swap Sequence Numbers:

      • Swap the sequence numbers of the selected row and the adjacent row 

    • Update Records:

      • Use the Dynamics 365 Web API (Xrm.WebApi.updateRecord) to update the sequence numbers of the affected Quote Product records 

    • Refresh Grid:

      • Use gridContext.getGrid().refresh() to refresh the view and display the updated order.

    4. Add Web Resource and Configure Buttons:

    • Create Web Resource: Create a JavaScript web resource and paste the code into it.

    • Add Web Resource to Form: Add the web resource to the Quote form.

    • Configure Command Bar Buttons:

      • For the "Move Up" button, set the action to "Run JavaScript function."

      • Function Name: moveRowUp

      • Parameter: Pass the execution context as the first parameter.

      • Repeat for the "Move Down" button and moveRowDown function.
     
    5. Printing into document:
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Tom_Gioielli Profile Picture
    3,096 Super User 2026 Season 1 on at
    Adding onto point three from Saif, I recently had a post about this same thing just the other day. Here is some more information about using a Custom PCF control to meet this requirement. I would consider this option both easier to implement and more user friendly than needing to add custom buttons to your grid and writing JavaScript.
     
     
    If this answer helped, please consider marking as verified

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 130 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 117

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans