Answered

Unable to process control, Control type UPLOAD, Unable to process property VALUE

I have a subprocess form that is using a file uploads control to display files from the main process. I believe I am mapping this attribute correctly in my associate event because all other data from the main process is being shown on the subprocess form. I am using the following code in that event to attach the attachments from the main process to the subprocess:

<FleetMemo.Approval.Attachments> = <FleetMemo.Attachment>;

Upon my workflow reaching this subprocess form, I receive the following error in the UI:

Error Type: BaseException

Error Message: Unable to process control: f58a3c3f-ed81-4307-89b7-23d1d28c14f0. Control type: Upload. Xpath: Approval.Attachments. Unable to process property: VALUE. Object reference not set to an instance of an object.

If I remove the file uploads control from that form, the rest of the form shows correctly with the data binding from the main process entity, but this control does not want to render at all. I believe this has something to do with the subprocess as I can add this control to the forms in the main process and it shows just fine with the files I uploaded in the first form of the workflow.

Comments (1)

photo
1

Dear Nicholas

Thank you for your question.

For "File" type attributes, please use below script for mapping

var oldFiles = <FleetMemo.Attachment>;

for (var i=0; i<oldFiles.Count; i++)

{

var File = Me.addRelation("FleetMemo.Approval.Attachments");

var oneOldFile = oldFiles[i];

var oldFileName = oneOldFile.getXPath("FileName");

var oldFileData = oneOldFile.getXPath("Data");

File.setXPath("FileName", oldFileName);

File.setXPath("Data", oldFileData);

}

Hope this helps!

Best Regards