22
Views
3
Comments
Entity Create or Update

if i use createorupdate action is there any way to know current action created or updated the record?

Hi,

Yes you can use one input of that entity primary key and at the time of add it will go NullIdentifier and at the time of update it will go Id of that particular record.

Let me know if you need more help

Thanks

Ruchi

Hi Rajesh,

Yes we can do that by checking on the id in createorUpdate action.

Thanks and regards

Champion

Hello

Adding to above replies, just a littel explanation for your exact question that - How we know,
So the answer is, 

For Creating a new Record

  • When we want to add a new record to our database table we should pass a NullIdentifier() to the Id attribute of your Entity (which is a Primary key it should be Unique) this scenario is applicable when Is Autonumber property of attribute is set to = Yes,
  • The second case is we pass the Identifier manually and if it is not found in your Entity(database table) that means the Identifier is Unique in that case it will create a new record.

For Updating a Record

  • When we update a record, we pass the Identifier of the record that we need to update. In that case that ID is already present in database hence in this case our update is triggered.

You can also check a very good explanation here by our OutSystems MVP's @Eduardo  and @Dorine  
https://www.outsystems.com/forums/discussion/85614/real-time-examples-to-use-create-entity-action-over-createorupdate/

 I hope this will help you to understand.

Best Regards
Tousif Khan

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.