Hi @Alison.Stewart ,
Usually for these cases I would create a custom Assembly application that would be called after the form is submitted.
The method in the assembly would have a WorkflowFile object parameter that would be expecting a file from the workflow as an IN parameter.
In the method, you can retrieve the content of that document as a byte array using the WorkflowFile’s Content property and then call the CRM’s API to send that document :
Example of an Assembly method usage with a file parameter:
1- Create a C# class library
2- Create the method that will retrieve the file and send it to the CRM via API
public string SendToCRM(WorkflowFile file){
CRM.API.SendFile(new MemoryStream(file.Content));
}
3- Build the solution and deploy the Assembly(dll file) in the wfgen\bin
folder
4- Create a new custom application of type assembly that references the newly created dll file.
5- Create a new action in the Workflow with the new custom application and map the file to be sent as an IN parameter.
This is a lengthier approach than using the .NET code in the form, but definitely more clean and maintainable.
Regards,
Eddy.