Copy Paste
Question

Hello


guys how do i clone on click

CopyCola.oml

Hi Jone,

If you send the data you are trying to copy directly to the "CreateOrUpdateCopy" action, the system will detect it as an update and try to update the existing data. If you want it to copy every time you click the button, you can use "CreateCopy" instead of "CreateOrUpdateCopy". Or you should assign NullIdentifier value for "GetCopies.List.Current.Copy.Id" before CreateOrUpdateCopy action.

If you wish, you can view the attached oml file.


Regards,
Yusuf

CopyColaFixed.oml

mvp_badge
MVP
Solution

Hello Jone,

Hope you're doing well.

What exactly do you want to achieve? Do you pretend to clone the record, is that it?

If so, you just need to get the record that you pretend to clone (using an aggregate/query to fetch it from the database) and create a new record with the same values.

Make sure that you use the Create<Entity> entity action in order to achieve this.


You should assign the values from the fetched record to the attributes of the new record.


Kind regards,

Rui Barradas

Hi Jone,

If you send the data you are trying to copy directly to the "CreateOrUpdateCopy" action, the system will detect it as an update and try to update the existing data. If you want it to copy every time you click the button, you can use "CreateCopy" instead of "CreateOrUpdateCopy". Or you should assign NullIdentifier value for "GetCopies.List.Current.Copy.Id" before CreateOrUpdateCopy action.

If you wish, you can view the attached oml file.


Regards,
Yusuf

CopyColaFixed.oml

Hello @Jone Berti,


I would love to help but I'm not fully understanding what is the goal here. 

What do you want to copy? A single attribute of the record? The record itself? 

And where it's to be paste?


Best regards,

Frederico

mvp_badge
MVP

It seems that he wants to clone a record from the list.

Hi @Rui Barradas 

That seems to be the goal here, but I'm not 100% sure. Still, we need to know where the info is supposed to be paste. It looks like he want to replicate the same record, if so, you already give the answer on your first reply. Just wanted to make sure if he wasn't looking for another scenario.

Cheers

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