Create Order Action
The gadget spec URL could not be found



At this point. you've updated the "Company" model to store next sequence number, created an action in the "Company" model to increment the next sequence number and established connection between "Company" and "CustomerOrders" model. The next step is to create the "Create Order" action.

Fetch the next sequence number
  
Create a new action "CreateOrder" using the "Insert Action" icon.
   
Insert an update command.
   
Click on the properties tab to configure the command parameters .

Param: Next_Sequence_Number
Value: =DGET(Company_Reference,
Company.Next_Sequence_Number)
 
Param: Order_Status
Value: ="Open"

Param: Order_Date
Value: =Today()


 Update Order ID
  
Insert another update command.
   
Click on the properties tab to configure the command parameters .

Param: Order_ID
Value: =CONCATENATE("ORD",
Next_Sequence_Number)
   
Why are we using two separate update commands to update the current model parameters?
  
 We want to fetch the next sequence number from the Company model and then concatenate it with "ORD" to create the order ID. If we were to use a single update command instead of the two commands that we currently have, then the order ID may not get updated correctly as all the rules will be fired simultaneously i.e. the DGET and CONCATENATE will be executed simultaneously. The order ID might be updated even before the next sequence number is fetched from the Company model.


Increment the sequence number
  
Insert a "CallParentAction" command.
   
Call parent action command is used to call a parent model action. The parent model action will be executed.

What parameters must be configured for "CallParentAction" command?
  • Parent Model
  • Parent Action Name
  • Context Cell Name
  
Click on the properties tab to configure the command parameters.

Parent-Name: Company_Reference(Company)
Parent-Action-Name: UpdateSeqNum
   


Submit to create order
  
Insert a submit command.
   
Click on the properties tab to configure the command parameters.

Select "Draft" from the dropdown list for "Submit from Activity" field.
   
What's the next step?

Create "Amend Order" action.