...
Code Block |
---|
FormsService fs = ...; ApplicationEntry appEntry = ...; // find app entry FormTypeEntry ftEntry = ...; // find template form entry ftEntry.setTitle(new PlainTextConstruct("MyForm")); ftEntry.setSummary(new PlainTextConstruct("MyForm Description")); FormTypeFeed ftFeed = appEntry.getFormTypeFeed(); FormTypeEntry newEntry = ftFeed.insert(ftEntry); |
How to copy a form?
Copying entails inserting an existing entry into a feed. The key difference between this case and a regular feed insert() is that the entry being inserted already has an id: this will trigger a copy.
Code Block |
---|
// get the FormTypeEntry you want to copy
FormTypeEntry ftEntry = ...;
// get the FormTypeFeed you will copy TO
FormTypeFeed targetFeed = appEntry.FormTypeFeed;
// Perform the copy
FormTypeEntry copy = ftFeed.Insert(FormType); |
Note |
---|
You can only insert into a feed that has an explicit owner, which is guaranteed above by getting the FormTypeFeed from the ApplicationEntry as opposed to getting a FormTypeFeed containing forms for all applications. |
How do I download an existing form?
...