Examples

The first sample shows how to add a new requisition, i.e. order a new part. In the sample we order two Nikon D200 from stock 1040. Notice that we do not bother setting up individual transactions for the inner attributes list as we do not need to track transactions on individual requisition line attributes.


              var update= {
                 AttributeAction : 0, //add
                 AttributeType : 5,   //requisition line
                 AttributeTransaction : "121212-33434-343-4", //unique id generated by client
                 AttributeData : { 
                   RequisitionLineUpdates : [ {
                     //Setup field for PartNumber
                     AttributeAction: 0, // Add
                     AttributeType: 0 //field
                     AttributeData : {
                         FieldName : "PartNumber",
                         FieldValue : "D200"
                         },
                      },
                      //Setup field for Quantity
                      AttributeAction: 0, // Add
                      AttributeType: 0 //field
                      AttributeData : {
                         FieldName : "Quantity",
                         FieldValue : 2
                         },
                      },
                      //Setup field for Stock
                      AttributeAction: 0, // Add
                      AttributeType: 0 //field
                      AttributeData : {
                         FieldName : "Stock",
                         FieldValue : "1040"
                         },
                      },
                      //Setup field for Requisition type
                      AttributeAction: 0, // Add
                      AttributeType: 0 //field
                      AttributeData : {
                         FieldName : "RequisitionType",
                         FieldValue : "1"
                         },
                      }]
               }
               





             The next sample show how to "deliver a part to a customer"


             var update = {
                 AttributeAction : 1, //modify
                 AttributeType : 5,   //requisition line
                 AttributeTransaction : "121212-33434-343-5", //unique id generated by client
                 AttributeData : { 
                   CombinedRequisitionLineId: "3563242:1"
                   RequisitionLineUpdates : [ {
                     //Setup field for adding a requisition line event
                     AttributeAction: 0, // Add
                     AttributeType: 6 // requisition line event
                     AttributeData : {
                         RequisitionFunction : "Delivered", //you can get valid functions from the server by calling 
                         ToLocation: { //must follow location rules for this function, check  for details on how to fill out this field
                             Location: "A1",
                             Stock: "Local"
                         }
                         Quantity : 1
                     }
                 }
                  

Properties

NameDescriptionTypeAdditional information
CombinedRequisitionLineId

Get or sets requisition line id. This property will be ignored when adding a new requisition line using the Web API. You will get the correct id in return from the server. Must be specified if you try to update or delete an existing requisition line.

string

None.

RequisitionLineUpdates

Gets or sets a list of requisition line updates

Collection of AttributeUpdateModel

None.