Hello, Is there any way to accomplish composite key feature?

Hello Dubey. In OutSystems, it's not possible to have composite keys. OutSystems promotes the use of surrogate keys, instead of natural keys, and with that approach there's no need to use composite keys. Please read this article to understand the differences between those types of keys.

If you need to integrate with an existing model, then OutSystems is able to import the composite keys, but they won't be considered as keys by the platform. You will still be able to use them for joins and take advantage of indexes and query optimizations.


You can however simulate composite keys by adding a composite, unique index using the attributes.


Thanks Kilian

You're most welcome :)

Ok, thank you.

Where do I create the composite unique index?  Then how?  Is this done in the extension?

Thank you.

All my data is on external databases - SQL Server.

Adding an index is greyed out - option only available for entities defined in OS.

Any ideas?

Hi Larry,

From what I know you can define indexes from management studio of your external database.

Hope this helps!

- Emman

Hi Larry,

Like Emman says, indexes in external databases are managed in the external databases, not by OutSystems (just like everything else, you can't change Attributes either, for example).