Expression for copying file from entity to collection row

helo everybody, in the help , i founded code for copy file from one attribute to another.

var OriginalFile = Me.getXPath("AgreementAprove.AgreementProject");//Go through the arrayfor(var i=0; i < OriginalFile.size(); i++){//Obtain original file var FileCopy = OriginalFile.get(i); var Name = FileCopy.getXPath("FileName"); var Data = FileCopy.getXPath("Data");//Copy original file in the destination file var NewFile = Me.addRelation("AgreementAprove.AgreementControversy"); NewFile.setXPath("FileName", Name); NewFile.setXPath("Data", Data);

How can i copy file from one attribute to attribute of the collection row?


Dear mikhaylov mikhail

A Member of our support team will contact you.

best regards

Luis Emilio


Would really appreciate if it would be possible to share the solution here.


Dear Users,

I have an example, I hope it helps you.

This example is perfect to use when you need to attach many files to an activity. This example copy from a parameter entity (fileParametrica) to a collection(Archivos), you need to follow-up these steps:

  • Create a Collection relationship to the process entity (One to Many). You need to create a collection entity and then a parametric entity. Help:
  • Then Create a rule on enter the activity. Help: You

    need to declare 2 variables:

    Int i=0; Object EntArchivosList=null;

    EntArchivosList= CEntityManager.GetEntity("fileParametrica").GetEntityList("","", "", "");

    for(i=0; i< EntArchivosList.Length; i++){

    var key=EntArchivosList.SurrogateKeyValue;
    var newFile=Me.addRelation("solicitud_credito.Archivos");