Skip to content

Create Purchase Request Entities

Key Lesson: The purchase request model uses separate Entities for the request itself and the individual items it contains.

The purchase request data model begins with two Entities: PurchaseRequest and PurchaseRequestItem.

PurchaseRequest represents the request itself and holds information that applies to the request as a whole. PurchaseRequestItem represents an individual item being requested, such as a laptop. A PurchaseRequest can contain one or more PurchaseRequestItem objects.

The relationship between the two Entities is configured in the next tutorial step.

Begin with the PurchaseRequest Entity. At this stage, it needs a cost center and a comment that can be used later when the request is reviewed.

  1. Go to Design.
  2. Under Object Types, select Entity.
  3. Select + to create a new Entity.
  4. Enter PurchaseRequest in the Id field, then select OK.
  5. In the GENERAL section, set Id type to number. The selected Id type determines the type of the unique identifier used for the Entity in the database.
  6. Add the following properties:
NAMETYPENotes
costCenter
This.CostCenter
References the CostCenter Static Entity. Leave the default expression empty so the user must select a cost center.
commentstringStores the comment entered when the purchase request is reviewed.
  1. Leave all other properties at their default values.

  2. Save and close the editor.

Tip

This, with a capital T, refers to the Module that the current business object belongs to. Typing This. in the Type or Default expression field displays suggestions for the Static Entities and Entities available in the current Module. Referring to the Module explicitly as Purchasing. is also possible, but is not encouraged.

The PurchaseRequestItem Entity represents the individual items added to a purchase request. Each item records what is being requested, the quantity, the budget amount, and the currency.

  1. Go to Design.
  2. Under Object Types, select Entity.
  3. Select + to create a new Entity.
  4. Enter PurchaseRequestItem in the Id field, then select OK.
  5. In the GENERAL section, set Id type to number.
  6. Add the following properties:
NAMETYPEDEFAULT EXPRESSIONNotes
descriptionstring(leave blank)Describes the requested item.
quantitynumber1Sets the requested quantity. New items default to 1.
budgetAmountnumber(leave blank)Stores the budget amount for the requested item.
currency
This.Currency
This.Currency.Usd
References the Currency Static Entity and defaults to USD.
  1. Leave all other properties at their default values.

  2. Save and close the editor.