This document describes how to consume the ProductionReceipt entity to perform a production receipt in Exact Globe Next.
The functionality provided in this entity is very close to the functional behavior when performing a production receipt in standard Exact Globe Next application. This entity only allows you to create a production receipt for a single production order at one time.
The entity supports the following actions:
Property
Description
ActualQuantity
Mandatory field (Double)
This field indicates the actual quantity to be receipt for the production receipt line.
The value should be greater than 0. The value will be validated with free stock quantity if the Check stock setting is enabled.
This field is only required upon performing the Create action.
BackFlush
Read only field (Boolean True/False) (Available since PU408)
The field indicates whether the planned item is back flush.
ID
Mandatory field (Long)
This field refers to the ID of the production receipt plan line.
Use this ID to retrieve a single production receipt line entity.
This ID must be provided upon performing the Create action. The ID must match the receipt line. Else, an error will be thrown.
To create a production receipt or an extra production receipt, set the ID = 0.
When performing the Update action, a dummy ID needs to be provided.
IsBatchItem
Read only field (Boolean True/False)
The field indicates whether the item is a batch item. If true, the SerialBatchNumber field must be provided with the correct value.
IsByProduct
The field indicates whether the production receipt’s item is a by product.
IsFractionAllowedItem
The field indicates whether the item is a divisible item. If it’s false, the receipt quantity should not contain any decimal value. Else, an error will be thrown.
IsSerialNumberItem
The field indicates whether the item is a serial item. If true, the SerialBatchNumber field must be provided with the correct value. Also, the ActualQuantity field must match the serial numbers provided.
ItemCode
Mandatory field (String)
This field indicates the item (make/by-product) that needs to be receipt. The value must match the item code in the planned receipt line.
A value must be provided for this field when performing the Create action.
Location
Optional field (String)
This field indicates the warehouse location of the item to be receipt.
This field should be provided if the Multiple Location setting is enabled in Exact Globe Next. Else, the location from the planned receipt line will be the default value.
Operation
Read only field (String)
This field shows the operation value of the planned receipt line.
PlannedQuantity
Read only field (Double)
This field indicate the original planned quantity for the production receipt line that need to be receipt.
ProductionOrder
This field indicates the production order that needs to be receipt.
This field is mandatory for the Create and Update actions.
RealizedQuantity
This field indicates the quantity of item that has been receipt in the production order for this planned production receipt line.
Resource
This field must be provided with a valid resource ID upon the Create action.
SerialBatchNumber
If the item to be receipt is a serial/batch item, a value must be provided for this field. The serial numbers provided must match the actual quantity. The Serial/batch numbers will be validated based on the Exact Globe Next settings. Production receipt line with serial number is supported in following methods
i. i. Multiple (same ID) planned production receipt line with different number
ii. This method is supported by saving multiple planned lines with same ID with different numbers with the Save action. The actual quantity of each line must be 1.
iii. ii. Single planned production receipt line with different number (as a string)
This method is supported by save single planned line with different number with Save action. The serial/batch number can be provided as a string with “,” as delimiter. The maximum limit is 50 numbers.
Note: if ActualQuantity = 1, the serial number will be assigned as provided.
Please refer to the section below for the sample of implementation.
Step
This field shows the step value of the planned receipt line.
ToBeRealizedQuantity
This field indicates the outstanding quantity for the production receipt line that needs to be receipted.
TransactionKey
Mandatory field (Guid)
The field indicates the set of production receipt lines that should be processed in single entry. All production receipt lines should consists the same value.
The field is required in both create and update action.
Sysguid
The field indicate the sysguid of the planned production receipt line.
Modified
The field indicates the last modified date of the planned production receipt line.
Warehouse
This field indicates the warehouse location of the item receipt. The warehouse rights will be validated.
This field must be provided when performing the ` action.
To create a production receipt with the ProductionReceipt entity, user should consume the entity in the following sequence:
Note: To split a receipt line into multiple lines with different warehouse locations, perform multiple entity Create actions with the same ID and different locations and quantities.
Method 1: Multiple (same ID) planned production receipt line with different number
Method 2: Single planned production receipt line with different number (as a string)
Please refer to document 22.148.798 for the general guideline on how to consume Exact Entity.
Step 1: Retrieve set
Private Function GetProductionReceiptRetrieveSet(ByVal ProductionOrder As String) As EntitiesData
Dim rc As New RetrieveCriteria
Dim ent As EntitiesData
Dim client As New EntitiesClientEG(_Service, "(local)\sql2008r2", "399")
rc.BatchSize = 10
rc.EntityName = _EntityName
rc.FilterQuery.Properties.Add(New QueryProperty() With {.PropertyName = "ProductionOrder", .Operation = "=", .PropertyValue = ProductionOrder})
ent = client.RetrieveSet(rc)
Return ent
End Function
Step 2: Retrieve single production receipt line (Optional)
Private Function RetrieveSingleProductionReceiptLine(ByVal ID As String) As EntityData
Dim p As NamedPropertyCollection(Of PropertyData)
'Dim client As New EntityClientEG(_Service, "(local)\sql2008r2", "399")
p.Add(New PropertyData() With {.Name = "ID", .Value = ID})
Try
Return _Client.Retrieve(New EntityData With {.EntityName = _EntityName, .Properties = p})
Catch ex As Exception
Throw
End Try
Step 3: Create single production line
Private Sub SaveProductionReceiptLine(ByVal ID As String, ByVal ProductionOrder As String,
ByVal ItemCode As String, ByVal Warehouse As String,
ByVal ResourceID As String, ByVal ActualQuantity As Double,
ByVal TranKey As String)
Dim ent As New EntityData
With ent
.EntityName = _EntityName
.Properties.Add(New PropertyData() With {.Name = "ID", .Value = ID})
.Properties.Add(New PropertyData() With {.Name = "ProductionOrder", .Value = ProductionOrder})
.Properties.Add(New PropertyData() With {.Name = "ItemCode", .Value = ItemCode})
.Properties.Add(New PropertyData() With {.Name = "Warehouse", .Value = Warehouse})
.Properties.Add(New PropertyData() With {.Name = "Resource", .Value = ResourceID})
.Properties.Add(New PropertyData() With {.Name = "ActualQuantity", .Value = ActualQuantity})
.Properties.Add(New PropertyData() With {.Name = "TransactionKey", .Value = TranKey})
End With
_Client.Create(ent)
End Sub
Step 4: Process production receipt
Private Sub ProcessProductionReceipt (ByVal ID As String, ByVal ProductionOrder As String, ByVal TranKey As String)
_Client.Update(ent)
Main Code
Private _Service As String
Private _Client As EntityClientEG
Private _EntityName As String = "ProductionReceipt"
Sub Main()
Dim ProductionReceipts As New EntitiesData
Dim ProductionOrder As String
_Service = String.Format("http://{0}:{1}/services", "localhost", "8010")
_Client = New EntityClientEG(_Service, "(local)\sql2008r2", "399")
ProductionOrder = "PR0400043996"
ProductionReceipts = GetProductionReceiptRetrieveSet(ProductionOrder)
If ProductionReceipts.Entities.Count > 0 Then
Dim TranKey As String = Guid.NewGuid().ToString
For Each ReceiptLine As EntityData In ProductionReceipts.Entities
Dim ID As String = (From p In ReceiptLine.Properties Where p.Name = "ID" Select p.Value).Single
Dim ItemCode As String = (From p In ReceiptLine.Properties Where p.Name = "ItemCode" Select p.Value).Single
Dim Warehouse As String = (From p In ReceiptLine.Properties Where p.Name = "Warehouse" Select p.Value).Single
Dim Resource As String = (From p In ReceiptLine.Properties Where p.Name = "Resource" Select p.Value).Single
Dim ActualQty As Double = (From p In ReceiptLine.Properties Where p.Name = "ToBeRealizedQuantity" Select p.Value).Single
SaveProductionReceiptLine(ID, ProductionOrder, ItemCode, Warehouse, Resource, ActualQty, TranKey)
Next
'CreateMultipleProductionReceiptlinesWithMultipleSerialNumbers(5899)
'CreateSingleProductionReceiptlineWithMultipleSerialNumbers(5899)
Private Sub CreateMultipleProductionReceiptlinesWithMultipleSerialNumbers(ByVal ID As String)
Dim p As New NamedPropertyCollection(Of PropertyData)
Dim ent As EntityData
ent = _Client.Retrieve(New EntityData With {.EntityName = _EntityName, .Properties = p})
If ent IsNot Nothing Then
If ent.Properties("IsSerialNumberItem").Value = True Then
'Assign serial number to for all to be relized quantity
For i As Long = 1 To ent.Properties("ToBeRealizedQuantity").Value
ent.Properties("SerialBatchNumber").Value = String.Concat("Serial", i)
ent.Properties("ActualQuantity").Value = 1
ent.Properties("TransactionKey").Value = TranKey
'Process the lines
ProcessProductionReceipt(0, ent.Properties("ProductionOrder").Value, TranKey)
End If
Private Sub CreateSingleProductionReceiptlineWithMultipleSerialNumbers(ByVal ID As String)
Dim serialNumber As New List(Of String)
serialNumber.Add(String.Concat("Serial", i))
ent.Properties("SerialBatchNumber").Value = String.Join(",", serialNumber.ToArray())
ent.Properties("ActualQuantity").Value = ent.Properties("ToBeRealizedQuantity").Value
The ProductionReceipt entity is available from product update 405 onwards.
Document Number: 26.158.240
Disclaimer Despite the continued efforts of Exact to ensure that the information in this document is as complete and up-to-date as possible, Exact can not be held accountable for the correctness and/or completeness and/or specific applicability of the published and/or requested information in this document. Exact shall not be liable for any direct, indirect, incidental, special or consequential damages, lost profits or for business interruption arising out of the use of this document. The extraction and use of information from this document remains at all times completely within the user's own risk.