Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
DAVID CHEN
5
Views
5
Comments
Entity and Structure Question
Question
Data
Database
In the advance query I can do {Table}.[column]
I was wondering if I can do the same for Structure? it doesn't seem to let me do it like {Structure}.[stColumn]
Also if its possible to convert Structure to Entity
Thanks
Izak Joubert
In response to your second question...
It is possible to "convert" a structure to an entity if you follow a few simple steps:
Assume you have an entity called "Widget" with Id (integer) and Description (text) attributes.
- Right click the Widget structure you want to convert and copy.
- Right click the Entities folder and paste. You will get a "Widget2" entity. Rename the entity as required.
- Select the Id attribute and set its "Is Mandatory" property to yes.
- Double click the entity and in the advanced editor popup, create a unique index with Id as the only attribute.
- Also in the same editor set the "Identifier Attribute" value to "Id"
Hope this helps
DAVID CHEN
Hi Izak
Thank you for your tip, but I was hoping I can get a solution converting the structure automatically written in codes instead of manually
Thanks
Ricardo Silva
In order to turn a structure into an entity all you really have to do is copy the structure, right click the entities folder and paste.
You'll get a new entity with the same definition as your structure.
Ricardo Silva
Which I now realize is exactly what Izak described.
David Chen: exactly what do you want to do?
Tiago Martins
Hi David,
Not sure if I understand exactly what you are trying to accomplish.
The notation
{table}.[column]
available in the advanced query widget, is there to help you link the meta-information of your entities with the actual database tables. I'm not sure why you would need to do the same with structures.
Izak and Ricardo have already described how can you easily convert a structure into an entity. If you are interested in refactoring you can also right-click your structure and use the "Find and Replace" feature to replace all usages in your code with your new entity. It's all pretty much done automatically for you.
Best regards
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...