Order Service class to generate both Sales Orders and Sales Order Lines. Service class is also exposed as Rest Resource.

Method Summary

Modifier and Type Method and Description
OrderService getInstance()
OrderService getInstance(String version)
void getApiResponse()
void createOrder()
void deleteOrder()
void updateOrder()
void OrderService()
void get(SearchRequest sr)
SalesOrder getSalesOrder(Id salesOrderId)
SalesOrder createOrder(SalesOrder so)
SalesOrderLine addItemToOrder(SalesOrderLine sol)
List<SalesOrderLine> addItemsToOrder(List sols)
void deleteItemFromOrder(Id idToDelete)
void deleteSalesOrder(Set ids)
void deleteItemsFromOrder(Set ids)
SalesOrderLine updateItemInOrder(SalesOrderLine line)
List<SalesOrderLine> updateItemsInOrder(List solLines)

Method Detail

This class supports the following methods:

global static OrderService getInstance()

Service get instance method that will return an instance of this service, either standard or overridden.


global static OrderService getInstance(String version)

Service get instance method that will return an instance of this service, either versioned or overridden.
Parameters

Name Type Description
version String undefined

global static void getApiResponse()

global static void createOrder()

global static void deleteOrder()

global static void updateOrder()

global OrderService()

OrderService Constructor that should not be called directly.


global virtual List<SalesOrder> get(SearchRequest sr)

Parameters

Name Type Description
sr SearchRequest undefined

global virtual SalesOrder getSalesOrder(Id salesOrderId)

Query the supplied Sales Order object and return the Sales Order and the Sales Order Lines.
Parameters

Name Type Description
salesOrderId Id Id

global virtual SalesOrder createOrder(SalesOrder so)

Create a Sales Order object by taking the wrapped version of the Sales Order SObject
Parameters

Name Type Description
so SalesOrder SalesOrder

global virtual SalesOrderLine addItemToOrder(SalesOrderLine sol)

Create a Sales Order Line object by taking the wrapped version of the Sales Order Line SObject. This method will also build the required package item at one time.
Parameters

Name Type Description
sol SalesOrderLine SalesOrderLine

global virtual List<SalesOrderLine> addItemsToOrder(List<SalesOrderLine> sols)

Create a Sales Order Lines object by taking the wrapped versions of the Sales Order Line SObject. This method will also build the required package item at one time.
Parameters

Name Type Description
sols List<SalesOrderLine> List

global virtual void deleteItemFromOrder(Id idToDelete)

Delete an item from the Sales Order by providing the Sales Order Line Id to remove
Parameters

Name Type Description
idToDelete Id Id

global virtual void deleteSalesOrder(Set<Id> ids)

Delete set of Sales orders by providing the Sales Order Id's
Parameters

Name Type Description
ids Set<Id> Set

global virtual void deleteItemsFromOrder(Set<Id> ids)

Delete set of items from the Sales order by providing the Sales Order Line Id's to remove
Parameters

Name Type Description
ids Set<Id> Set

global virtual SalesOrderLine updateItemInOrder(SalesOrderLine line)

Update an existing Sales Order Line that is already inserted into the database.
Parameters

Name Type Description
line SalesOrderLine SalesOrderLine

global virtual List<SalesOrderLine> updateItemsInOrder(List<SalesOrderLine> solLines)

Update an existing set of Sales Order Line's that is already inserted into the database.
Parameters

Name Type Description
solLines List<SalesOrderLine> List