Reference > Shop flow URLs > Order Management subsystem URLs > Orders URLs
SetOrderTemplate URL
Sets or resets a "template" order or a "current template" order.
URL structure
- http:// host/ path/
- The fully qualified name of the WebSphere Commerce Server and the configuration path.
name-value pair with the & character. For a detailed description of the parameters and their values, see 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 name-value pairs to be added to the redirection URL. The value of each 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
- Orders are processed in ascending sequence of i.
- The CheckOrderTemplateCmd task command is called for each of the specified orders to check whether the customer is allowed to mark or unmark that order.
- If the customer is allowed, then the order is marked or unmarked in the ORDERTMPL table, using the ResolveOrdersCmd task command, as specified by the usage_ i parameter.
Exception conditions
The CheckOrderTemplateCmd task command uses 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 are set:
- ERROR_CODE=601
- orderId= the offending order ID
Related concepts
Related reference
Order Management subsystem URLs