Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to reset some attributes on duplicate of entity

emil_rowland
Level 2
Level 2

Hi,

 

In a form how do I handle the first save if some one duplicates the entity?

I have some attributes that needs to be reset when someone copies/deduplicate the entity. Now when I duplicate the entity all attributes is being passed to the new entity.

 

//Emil

1 Accepted Solution
Adhiyan
Correct answer by
Employee
Employee

Hello Emil,

 

You should use the defOnDuplicate="true" or "false" in the schema which holds the entity .

The defOnDuplicate function if set to true , uses the default value of the schema instead of the stored value in the record being duplicated.

 

Examples can be found in the nms:delivery OOB schema like :

<attribute defOnDuplicate="true" desc="Start date if action is deferred or delayed, validity date otherwise."
label="Contact date" name="contactDate" type="datetime"/>

 

Regards,
Adhiyan

View solution in original post

2 Replies
Manoj_Kumar_
Community Advisor
Community Advisor

Hello @emil_rowland 

 

Can you please share more details like some screenshot of webForm/ Input form?

Adhiyan
Correct answer by
Employee
Employee

Hello Emil,

 

You should use the defOnDuplicate="true" or "false" in the schema which holds the entity .

The defOnDuplicate function if set to true , uses the default value of the schema instead of the stored value in the record being duplicated.

 

Examples can be found in the nms:delivery OOB schema like :

<attribute defOnDuplicate="true" desc="Start date if action is deferred or delayed, validity date otherwise."
label="Contact date" name="contactDate" type="datetime"/>

 

Regards,
Adhiyan

View solution in original post