Today I would like to talk about how to disable paste rows in Business Central.
As you might know, in Business Central, you can copy one or more rows from a list or a single field on a page, and then paste what you copied into the same page, another page, or an external document (like Microsoft Excel and Outlook email). In short, to copy, you press CTRL+C (cmd+C in macOS) on your keyboard. To paste, you press CTRL+V (cmd+V in macOS).
What can I copy and paste?
- Copy one or more rows in Business Central to the same list, or to any list with identical columns.
- Copy one or more rows in Business Central and paste into Excel or other applications.
- Copy one or more rows in Excel and paste into a Business Central list.
- Copy the value of an individual field in Business Central and paste it anywhere.
Test Video: I created a new table and a new list page for the test
You can copy rows in any kind of list, including worksheets, FactBoxes, or list that are embedded on a page (like lines of a sales order). However, to paste rows, the list must be editable.
So is there a way to keep the page editable, but not allow users to paste rows?
Yes, this time we just use PasteIsValid Property.
PasteIsValid Property: Sets whether inserting records into this table using the paste command is enabled.
Applies to: Table
Property Value: True if you want to allow insert by pasting; otherwise, false. The default value is true.
Let’s test it again: When the PasteIsValid property is false, the copied rows in Excel can only be pasted into one cell.
1. If records are usually inserted in the table through an external code unit function, set the PasteIsValid property equal to false.
2. The OnInsert Trigger of the table is executed when a record is inserted by pasting.
3. Copy and paste are available in the browser or the Business Central app.
4. The property ‘PasteIsValid‘ cannot be customized through a table extension.
5. This PasteIsValid Property is also used in some standard tables.
Hope this will help.
Thanks for reading.