How Do I Resolve the Error using File Attachment GetFileName in Activities in XMPro 5.1.1?

How Can We Help?

< Back

I get the following error when I try to use the customFunctions.GetFileName() function in XMPro 5.1.1.

I am running the site in managed code (C#).

The name ‘customFunctions’ does not exist in the current context.

Answer

The managed code to use would be:

Functions customFunctions = new Functions();
string filename = customFunctions.GetFileName(activity.GetControlValue("FileAttachmentControlName"));
activity.SetControlValue("ControlToSet",filename);

I have noticed the drag and drop, excludes the declaration which will be amended to include.

Resolution: VB.Net

For VB.Net scripting:

Dim customFunctions As New Functions()
Dim filename As String = customFunctions.GetFileName(activity.GetControlValue("FileAttachmentControlName"))
activity.SetControlValue("ControlToSet", filename)
Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X