SetOrderTemplate command

This command sets or resets a "template" order or a "current template" order. 

Command structure

http://host_name/path/
The fully qualified name of your WebSphere Commerce Server and the configuration path.

Diagram of the command structure: the command starts with the fully qualified name of your WebSphere Commerce Server and the configuration path, followed by the command name, SetOrderTemplate  and the ? character. End the command with a list of parameters in the form of name value pairs. Separate each name value pair with the & character. For a detailed description of the parameters and their values, refer to the list entitled Parameter values.

Parameter values

forUser
The logon ID of the user on whose behalf the command will be run; only a person with the authority to process orders can specify this parameter.
forUserId
Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
langId
Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
storeId       
Sets the store ID of the destination order. It is also used to resolve special abbreviations (".",  "*",  ".t", ".**.",  and "*t") when they appear in fromOrderId_i, toOrderId, orderInfoFrom, and payInfoFrom. For example, the following command refers to all pending orders of member 1001 in store 1: 
    fromOrderId_1=.&memberId_1=1001&storeId=1
URL
(Required) The redirection URL that is called when the command successfully completes.
orderId_i
Specifies zero or more orders, using order reference numbers or one of the Order abbreviations ".", "*", ".t", "*t"
memberId_i
The reference number of a member, used to resolve special abbreviations (".", "*", ".t", ".**.", and "*t") when they appear in fromOrderId_i.  For example, the following command refers to all pending orders of member 1001: 
    fromOrderId_1=*&memberId_1=1001 The default value is the member ID of the current user.  If the current customer attempts to access the orders of other customers but is not authorized to do so, an exception is thrown.
usage_i
If orderId_i is specified, a value for usage_i must also be specified. Specify 1 to mark the specified orders as current template orders for the customer executing this command. Specify 0 to mark the orders as (non-current) template orders for the customer, and specify -1 to unmark the specified orders for the customer. 
storeId_i
The store reference number. It is used when evaluating the special abbreviations ".", "*", ".t", and "*t" for the value of the orderId_i parameter. If it is not specified, it defaults to the value provided by the storeId parameter. If neither storeId_i nor storeId are specified, then the special abbreviations are evaluated for all stores. 
outOrderName
Specifies the names of name-value pairs to be added to the redirection URL. The value of each added name-value pair is the reference number of the destination order.  The default value is "orderId". This parameter can be repeated.

Example

The following example makes the order with reference number 5137 the only current template for store 2066 and the customer executing the command, and re-directs to a URL that displays that order.

http://myhostname/webapp/wcs/stores/servlet/SetOrderTemplate?storeId=2066
&orderId_1=.t&ordert_usage_1=0&orderId_2=5137&ordert_usage_2=1
&&URL=/webapp/wcs/stores/servlet/OrderDisplay?status%3DP%26orderId%3D.t

Behavior

Exception conditions

The CheckOrderTemplateCmd task command will use the error view SetOrderTemplateErrorView to throw an ECApplicationException of type _ERR_SET_ORDER_TEMPLATE if the SetOrderTemplate command is denied access to an order.  The following name-value pairs will be set: