This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VAF C# copy Object AND set workflow state

Hi community, 

I'm working through the copyObject example https://developer.m-files.com/Samples-And-Libraries/Samples/Processes/Copying-Objects/ 

This works fine. Now I was wondering if and how it is possible to set the cloned object to a certain workflow (and workflow-state).

var ClonedObjectId = env.Vault.ObjectOperations.CreateNewObjectExQuick(
                env.ObjVer.Type,
                newObjectPropertyValues,
                newObjectSourceFiles,
                isSingleFileDocument,
                CheckIn: true,
                AccessControlList: accessControlList);

Since this "is not an object itself" but only returns the ID of the new created object.... My approach would be to pick up / search for the object with the ClonedObjectID and set the workflow / state afterwards.

However I figure I'd then would already create version 2 by changing the workflow (and workflow state).

Is there an approach to set the workflow / state right away?

Kind of looking for something like 

ClonedObject.SetWorkflowState(WF, WFS);

Thank you 

Best regards

Alex