The create CommandUsing the create Command with a Facility as Target Using the create Command with a Community as Target Using the create Command with an Item as Target Using the create Command with a Database as Target Using the create Command with a Calendar as Target Using the create Command with a Room as Target Using the create Command with a ProjectSchedule as Target Using the create Command with a ProjectTask as Target Using the create Command with a DBProcess as Target
IntroductionFor the create command, the XML query contains the object being created, using the same XML schema as the data returned by the getproperties command. The target of the command is the parent or container in which the object will be created. For instance, the Facility would be the target for creating an eRoom. The following is an example that creates a note page in the item box of the home page: <er:command er:select="Rooms/Room[URLName=' NewProductLaunch']/HomePage"> <er:create> <er:Item xsi:type="erItemTypeNotePage"> <er:Name>New Note</er:Name> <er:ShowAttachments>true</er:ShowAttachments> <er:ShowTopic>true</er:ShowTopic> <er:Description xsi:type="erTextTypePlain">A simple plain text note</er:Description> </er:Item> </er:create> </er:command> In the above example, the Name and Description are required properties. The create command will fail if they are not present. ShowTopic and ShowAttachments are optional. The response from the above command contains a status element, and if the command succeeded, it also contains the ID of the object that was created: <er:response> <er:status> <er:code>0000000000</er:code> <er:description>Success</er:description> </er:status> <er:ID>0_396</er:ID> </er:response>
Using the create Command with a Facility as TargetWhen the facility is the target of the create command, you can create eRooms, members, and licenses. Creating a RoomTo create an eRoom, you must supply the URLName
and DisplayName
as required parameters. If you supply an optional TemplateRoom
parameter, you can specify an existing room in the same facility for use
as a template in creating the new eRoom. The following sample shows all
three parameters in use: <er:command> <er:create> <er:Room> <er:URLName>newroom</er:URLName> <er:DisplayName>Created from a template</er:DisplayName> <er:TemplateRoom>projectplans</er:TemplateRoom> </er:Room> </er:create> </er:command>
This command creates a room named "newroom", with the display name "Created from a template" using the existing room named "projectplans" as a template. Creating a License KeyCreating a license key amounts to adding a license string to the facility. To create a license, the required and only parameter is the LicenseKey. Using the create Command with a Community as TargetWith a Community as the target of the create command, you can create a Member (user or group), or a Facility (SiteFacility). Creating a MemberA member can be either a user or a group. The only required parameter to create a user is the LoginName. For a group, the required parameter is name. Which one is being created is determined by the xsi:type attribute on the member element. For example, to create a user: <er:command> <er:create> <er:Member xsi:type="erMemTypeUser"> <er:LoginName>hford</er:LoginName> <er:Email>hank@ford.com</er:Email> <er:FirstName>Henry</er:FirstName> <er:LastName>Ford</er:LastName> <er:TimeZone>erTimeZoneCentralStandardTime</er:TimeZone> </er:Member> </er:create> </er:command>
Using the create Command with an Item as TargetUsing an Item as the target, you can create the following objects as children of the target Item:
Using the create Command with a Database as TargetWith a database as target, you can create DBColumns and DBRows. Using the create Command with a Calendar as TargetWith a Calendar as the target of the create command, you can create CalendarEventPages. Using the create Command with a Room as TargetWith a Room as the target of the create command, you can create a Member, but only if it is of type erMemTypeCustomRole. Using the create Command with a ProjectSchedule as TargetWith a ProjectSchedule as the target of the create command, you can create a ProjectTask. Using the create Command with a ProjectTask as TargetWith a ProjectTask as the target of the create command, you can create a ProgressReport. Using the create Command with a DBProcess as TargetWith a DBProcess as the target of the create command, you can create a ProcessStep. |