Multple binary data attributes in single entity

Multple binary data attributes in single entity

  

I am not able to create multiple binary data in my product entity. Then I decided to create one - one mapping for with 2 seperate tables but while creation of new record i  want to make contents from both table as mandatory

Hello Nihal,

I'm afraid you will have to take care of the validation in your logic, as it is not possible to enforce the extension entity records to exists before the record in the main entity is created.

Just check if both contents are present when saving the records and if not, act accordingly.

Cheers

Eduardo Jauch wrote:

Hello Nihal,

I'm afraid you will have to take care of the validation in your logic, as it is not possible to enforce the extension entity records to exists before the record in the main entity is created.

Just check if both contents are present when saving the records and if not, act accordingly.

Cheers

Thanks Eduardo 


Can we merge two entities directly where each entity consists Binary attribute ? If yes then whether it wil allow to add record with all details.

Nihal Shaikh wrote:

Can we merge two entities directly where each entity consists Binary attribute ? If yes then whether it wil allow to add record with all details.

Sorry, but I do not understood your question.

What do you mean by "merge" entities?
In OutSystems, an entity can have only a single attribute of type Binary.

If you have two entities B and C with a binary field each, both being an extension of entity A, you need FIRST save the record of entity A, get its ID and use it to sava the record in B and in C.

If you need to validate that B and C binary content exists (in business concept they are mandatory), than you can validate, before recording A, that both B and C content exists. If one or both are missing, you alert the user and stop the action.

Cheers.


Hi Nihal,

What do you mean "merge two entities directly"?

In any case, when creating (or updating) an entity using the Entity Actions you have to do it using the correct Entity Action, one record at a time.

I am curious about your datamodel, because your original question was about a product-entity with 2 binary-fields.



I want to create table with below fields 

1. Product Id

2. Product Name

3. Product Icon

4. Product Banner Image

5. Product Application Imgae

I want to perform Create, update, delete against above table but outsystems wont allow to add multiple binary attributes in single entity.

My question is how to design schema with seperate entity with each binary attribute & how to perform Create, Delete products operation against all attributes.


Nihal Shaikh wrote:

I want to create table with below fields 

1. Product Id

2. Product Name

3. Product Icon

4. Product Banner Image

5. Product Application Imgae

I want to perform Create, update, delete against above table but outsystems wont allow to add multiple binary attributes in single entity.

My question is how to design schema with seperate entity with each binary attribute & how to perform Create, Delete products operation against all attributes.



Hello Nihal,

I think this is the best way:



Bruno Schumacher wrote:

Nihal Shaikh wrote:

I want to create table with below fields 

1. Product Id

2. Product Name

3. Product Icon

4. Product Banner Image

5. Product Application Imgae

I want to perform Create, update, delete against above table but outsystems wont allow to add multiple binary attributes in single entity.

My question is how to design schema with seperate entity with each binary attribute & how to perform Create, Delete products operation against all attributes.



Hello Nihal,

I think this is the best way:



with some extra info on the mimetype etc..



Nihal

I am not sure if I am adding to previous contributions, but to put it in other words...


The best way is create a second entity that connect to the main entity with a relation one-to-many, and in the second entity you can save how many images you need (one for row) and keep linked to the first by the ID.


I hope this help