Modifica

Condividi tramite


Write extensible tables

Note

Community interest groups have now moved from Yammer to Microsoft Viva Engage. To join a Viva Engage community and take part in the latest discussions, fill out the Request access to Finance and Operations Viva Engage Community form and choose the community you want to join.

Tables have a rich extension model that extenders can use to add fields, field groups, indexes, relations, methods, and more.

Unique indexes

Extensions can't change unique indexes. Unique indexes define a table constraint, and they often also define the key of the rows in the tables. You can't change unique indexes, because such changes change the nature of the table. Therefore, there's a high risk that the changes cause logical conflicts with future versions of the solution that defines the table, or with other solutions that consume the table.

Avoid unique indexes that are likely to change either now or in the future. For example, don't create a unique index on product dimensions such as color, size, style, and configuration. Instead, create a unique index on a distinct product variant, so that the index doesn't need to change if new product dimensions are added.

If you require an extensible uniqueness constraint on multiple columns, consider creating a hash of the columns' values. For an example, see the NumberSequenceScope table.

Data events

Tables have many predefined data events that are automatically raised.

Avoid calling doInsert(), doUpdate(), and doDelete(). These methods prevent the data events from being raised and make your table harder to extend. Instead, call insert(), update(), and delete().

Field groups

Always use field groups to group related fields, and to build forms and reports. By consistently using this approach, you enable the extension to surface additional fields in forms and on reports by extending the field group.