How can I copy field values from one form to another that is related?

Tabla de contenidos

Athento allows you to copy/inherit field values from a main form to its related forms and vice versa, through the operation "Copy metadata of the current document to related documents or viceversa".

To do this, you must install the operation from the Document Operations Marketplace.

Next, indicate in which phase you want the operation to be executed, example: postvalidation, if we want the metadata to be copied after clicking the validate button.

Once the operation is installed, we must click on the option "Edit configuration"

You can configure the operation like this:

  • Map_metadata corresponds to the names of the fields that inherit the information and those that will receive the values. You must initially copy the field from form 1 (Parent or who will inherit the information), followed by the field from form 2 (child or who receives the information from the other form).

Indicate the fields with the following structure

{'metadata.sourceField':'metadata.targetField'}

When it is required to inherit several metadata between the forms, it must be filled in as follows:

{'metadata.sourceField1':'metadata.targetField1',
   'metadata.sourceField2':'metadata.targetField2'}

Next, fill in either Copy_to_doctype or Copy_from_doctype (Only one of them) depending on what you want to do:

  • Copy_from_doctype: If we indicate in this parameter the name of a form type, the metadata will be copied from the related one that has said form type to the current document.
  • Copy_to_doctype: If we indicate in this parameter the name of a form type, the metadata will be copied from the current document to the related one that has said form type..