Delete and Update in Outsystems

Delete and Update in Outsystems

  

Assalamu'laiakum.

I'm Fahmi.

When i want to update and delete data, should i have to advanced sql ? or just make the run server action ?

I'm newbie here, so plese help me haha.

Thanks

fahmi fachrurozi wrote:

Assalamu'laiakum.

I'm Fahmi.

When i want to update and delete data, should i have to advanced sql ? or just make the run server action ?

I'm newbie here, so plese help me haha.

Thanks

Hi Fahmi,

Both ways are fine, If you want to delete or update more than one record at a time based on your condition than Advance Sql can be use. Otherwise you can use Sever action to delete or update single record at a time.

Sachin


Sachin Mahawar wrote:

fahmi fachrurozi wrote:

Assalamu'laiakum.

I'm Fahmi.

When i want to update and delete data, should i have to advanced sql ? or just make the run server action ?

I'm newbie here, so plese help me haha.

Thanks

Hi Fahmi,

Both ways are fine, If you want to delete or update more than one record at a time based on your condition than Advance Sql can be use. Otherwise you can use Sever action to delete or update single record at a time.

Sachin


The possibility record that could be deleted or updated in Profile Entity are Username, Photo, And Password. So i have to use Advanced SQL or just RunServer Action ?


Hi Fahmi,

If you need to update some/all attributes of a single entity record (like changing the Username of a Profile entity record you suggest) then you will most likely want to use the UpdateProfile Entity Action to do it.

The same if you have the Id of the record you want to delete, just use the DeleteProfile Entity Action.

What Sachin was mentioning is if you need to update/delete multiple records/rows based on some condition (e.g. delete all Log entities whose Timestamp attribute is older than two weeks) then you're probably better off with using a SQL statement.

Hi Fahmi,

I am agree with Sachin.For delete you should look into entity. What type of delete rule you have applied.

-HM-

Jorge Martins wrote:

Hi Fahmi,

If you need to update some/all attributes of a single entity record (like changing the Username of a Profile entity record you suggest) then you will most likely want to use the UpdateProfile Entity Action to do it.

The same if you have the Id of the record you want to delete, just use the DeleteProfile Entity Action.

What Sachin was mentioning is if you need to update/delete multiple records/rows based on some condition (e.g. delete all Log entities whose Timestamp attribute is older than two weeks) then you're probably better off with using a SQL statement.


Allright man, i got it. Thanks :)

Hitesh Maran wrote:

Hi Fahmi,

I am agree with Sachin.For delete you should look into entity. What type of delete rule you have applied.

-HM-

Ok Hitesh, thanks


Fahmi,

If one of the answers solves your issue please mark it as solution. If none does but you managed to figure out how to solve it, please share with the community as well and mark it as the solution, this way you'll help others that may have the same doubt.

Thanks!