How to reset some attributes on duplicate of entity | Community
Skip to main content
emil_rowland
Level 2
May 22, 2020
Solved

How to reset some attributes on duplicate of entity

  • May 22, 2020
  • 2 replies
  • 3571 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Adhiyan

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

2 replies

Manoj_Kumar
Community Advisor
Community Advisor
May 22, 2020

Hello @emil_rowland 

 

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

Manoj  | https://themartech.pro
Adhiyan
Adobe Employee
AdhiyanAdobe EmployeeAccepted solution
Adobe Employee
June 8, 2020

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