OrderGroup.AddItemsFromTemplate

Ee810923.c++_on(en-US,CS.10).gifEe810923.vb_off(en-US,CS.10).gif

Use this method to add the line items associated with an on-disk OrderGroup to the current OrderGroup object.

This method iterates across all the OrderForms in the specified template and adds them to the current OrderGroup. If the OrderForms being added already exist, the line items on the template OrderGroup are simply added. When non-existing OrderForms are encountered, the method will add the OrderForm in its entirety to the OrderGroup including OrderForm-level dictionary values.

 The OrderGroup keeps a counter of total line items at OrderForm and OrderGroup levels. For the OrderGroup level, it keeps track of the number of line items in all the OrderForms. This value is held under the key "total_lineitems".

Definition

Sub AddItemsFromTemplate(OrderGroupID As String)

Parameters

OrderGroupID

A String that specifies the OrderGroup ID for the template.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

Ee810923.note(en-US,CS.10).gif Note

  • It is the responsibility of the application to implement security. This method does not check that the user ID of the template is the same as the user ID specified in the initialization call.

This method also works on previously submitted orders and baskets, as well as OrderGroups with Template (Saved Order) status.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' oOrderGroup is a Commerce.OrderGroup object
' myOGID is a GUID String
myOGID ="754C40C6-EAA9-454C-A8AB-02789FBE0FB9"
oOrderGroup.AddItemsFromTemplate(myOGID)

See Also

OrderGroup Object


All rights reserved.