Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Programmatically move XForm to another XForm folder?

Vote:
 

Hi!

Does anyone have an exampleon how to use code and move a certain XForm to another XForm folder?

Should one use XFormFolder.Move, XForm.Folder or something?

 

I'm running EPiServer CMS 5 R2.

 

#45087
Oct 29, 2010 11:02
Vote:
 

HI Marcus!

Either way works:

Guid formId = new Guid("...form id here...");
XFormFolder destFolder = XFormFolder.Create("/TestFolder2");

// method 1
XFormFolder.Move(formId, destFolder);

// method 2
XForm form = XForm.CreateInstance(formId);
form.Folder = destFolder;
form.Save();


/johan    

#45101
Oct 29, 2010 15:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.