What happens internally in the Outsystems Delete action for entities?

What happens internally in the Outsystems Delete action for entities?

  

Dear all,

I want to delete a record for a given identifier. That identifier can be null. In these cases, I expect that outystems does not even communicate to the database. But I am not sure about that. Maybe the blackbox action by outsystems tries to do some delete-statement to the database. Do you know what happens behind the scenes and can you give a tip how I can get more insight in such Outsystems-features? This description (link) could not give me the answer to my question.

Greetings, Jonathan

Hi Jonathan,

You need to check if the identifier is null before trying to use the delete action of the entity. if the identifier is null this action will throw an error.

Regards,

Marcelo

Hi Jonathan

Delete action needs Identifier to delete the record. 

If you want to delete the record having nullidentifier, you should write Advance query and pass input parameter to it of type identifier and pass value to it as nullidentifier.


Thanks and Regards,

Suraj Borade

Marcelo Ferreira wrote:

Hi Jonathan,

You need to check if the identifier is null before trying to use the delete action of the entity. if the identifier is null this action will throw an error.

Regards,

Marcelo


Hi Marcelo, thanks for your reply. However, I did not get any error in the interface or in service center error log.

Suraj Borade wrote:

Hi Jonathan

Delete action needs Identifier to delete the record. 

If you want to delete the record having nullidentifier, you should write Advance query and pass input parameter to it of type identifier and pass value to it as nullidentifier.


Thanks and Regards,

Suraj Borade

I just wanted to circumvent communication to the database if this is not necessary. I conclude that this is only possible via a separate if-statement in the outsytems code. Thanks for your reply.


DeHollaender wrote:

Suraj Borade wrote:

Hi Jonathan

Delete action needs Identifier to delete the record. 

If you want to delete the record having nullidentifier, you should write Advance query and pass input parameter to it of type identifier and pass value to it as nullidentifier.


Thanks and Regards,

Suraj Borade

I just wanted to circumvent communication to the database if this is not necessary. I conclude that this is only possible via a separate if-statement in the outsytems code. Thanks for your reply.


You should ALWAYS wrap the CRUD actions in wrappers anyways... have your wrapper just quietly exit on a NULL input.

J.Ja


Justin James wrote:

DeHollaender wrote:

Suraj Borade wrote:

Hi Jonathan

Delete action needs Identifier to delete the record. 

If you want to delete the record having nullidentifier, you should write Advance query and pass input parameter to it of type identifier and pass value to it as nullidentifier.


Thanks and Regards,

Suraj Borade

I just wanted to circumvent communication to the database if this is not necessary. I conclude that this is only possible via a separate if-statement in the outsytems code. Thanks for your reply.


You should ALWAYS wrap the CRUD actions in wrappers anyways... have your wrapper just quietly exit on a NULL input.

J.Ja



Yes I ALWAYS wrap CRUD actions inside wrappers since I have learnt why should we do that. Here I just wanted to show the example :)