This document describes how to consume the ProductionIssue entity to perform a production issue in Exact Globe Next.
The functionality provided in this entity is very close to the functional behavior when performing a production issue in standard Exact Globe Next application. This entity only allows you to create a production issue for a single production order at one time.
The entity supports the following actions:
Property
Description
ActualQuantity
Mandatory field (Long)
This field indicates the actual quantity to be issue for the production issue 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 create action.
BackFlush
Read only field (Boolean True/False)
The field indicates whether the item is back flush for the production issue line.
Condition
Read only field (String)
The field indicates the condition of the production issue line.
The following are the descriptions of the values:
N – Always
S - Once per production Order
F - Phantom
W – Waste
U - Once per production order
O – Optional
P - Packaging
ID
This field refers to the ID of the production issue plan line.
Use this ID to retrieve a single production issue line entity.
This ID must be provided upon performing the Create action. The ID must match the issue line. Else, an error will be thrown.
To create extra production issue or new production issue, set the ID = 0.
When performing the Update action, a dummy ID needs to be provided.
IsBatchItem
The field indicates whether the item is a batch item. If true, the SerialBatchNumber field must be provided with the correct value.
IsFractionAllowedItem
The field indicates whether the item is a divisible item. If it is false, the issue 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 issued. The value must match the item code in the planned issue line.
This field must be provided when performing the Create action.
ItemDescription
(Available since PU406)
This field indicates the description of the production issue line’s item.
ItemType
This field indicates the item type of the production issue line’s item.
The Following are the descriptions of the values:
S – Standard
P – Phantom
B - Bulk issue
H - Labor hour
M - Machine hour
Location
Optional field (String)
This field indicates the warehouse location of the item to be issued.
This field should be provided if the Multiple Location setting is enabled in Exact Globe next. Else, the location from the planned issue line will be the default value.
This field is only required upon performing the Create action.
Operation
This field shows the operation value of the planned issue line.
PlannedQuantity
Read only field (Double)
This field indicates the original planned quantity for the production issue line that needs to be issued.
ProductionOrder
This field indicates the production order that needs to be issued.
This field is mandatory for the Create and Update actions.
RealizedQuantity
This field indicates the quantity of item that has been issued in the production order for this planned production issue line.
Resource
This field must be provided with a valid resource ID upon performing the Create action.
SerialBatchNumber
If the item to be issued is a serial/batch item, a value must be provided for this field. The serial numbers provided must match the actual quantity. Serial/batch numbers will be validated based on the Exact Globe Next settings. Production issue line with serial number is supported in the following methods:
i. i. Multiple (same ID) planned production issue line with different number
ii. This method is supported by save multiple planned line with same ID with different number with Save action. The actual quantity of each line must be 1.
iii. ii. Single planned production issue line with different number (as a string)
This method is supported by save single planned line with different number with the 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 issue line.
ToBeRealizedQuantity
This field indicates the outstanding quantity for the production issue line that needs to be issued.
TransactionKey
Mandatory field (Guid)
The field indicate the set of production issue lines that should be processed in a single entry. All production issue lines should consist of the same value.
The field is required in both the Create and Update actions.
Unit
The field indicates the unit for the quantity in the production issue line.
This unit refers to the item’s sales unit.
Sysguid
The field indicates the sysguid of the planned production issue line.
Modified
The field indicates the last modified date of the planned production issue line.
Warehouse
This field indicates the warehouse location of the item issued. The warehouse rights will be validated.
To create a production issue with the ProductionIssue entity, user should consume the entity in the following sequence:
Note: To split an issue line into multiple line with different warehouse location, perform multiple entity create actions with the same ID and different location and quantity.
Method 1: Multiple (same ID) planned production issue line with different number
Method 2: Single planned production issue 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 GetProductionIssueRetrieveSet(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 issue line (Optional)
Private Function RetrieveSingleProductionIssueLine(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 SaveProductionIssueLine(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 issue
Private Sub ProcessProductionIssue (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 = "ProductionIssue"
Sub Main()
Dim ProductionIssues 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"
ProductionIssues = GetProductionIssueRetrieveSet(ProductionOrder)
If ProductionIssues.Entities.Count > 0 Then
Dim TranKey As String = Guid.NewGuid().ToString
For Each IssueLine As EntityData In ProductionIssues.Entities
Dim ID As String = (From p In IssueLine.Properties Where p.Name = "ID" Select p.Value).Single
Dim ItemCode As String = (From p In IssueLine.Properties Where p.Name = "ItemCode" Select p.Value).Single
Dim Warehouse As String = (From p In IssueLine.Properties Where p.Name = "Warehouse" Select p.Value).Single
Dim Resource As String = (From p In IssueLine.Properties Where p.Name = "Resource" Select p.Value).Single
Dim ActualQty As Double = (From p In IssueLine.Properties Where p.Name = "ToBeRealizedQuantity" Select p.Value).Single
SaveProductionIssueLine(ID, ProductionOrder, ItemCode, Warehouse, Resource, ActualQty, TranKey)
Next
Private Sub CreateMultipleProductionIssuelinesWithMultipleSerialNumbers(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
ProcessProductionIssue(0, ent.Properties("ProductionOrder").Value, TranKey)
End If
Private Sub CreateSingleProductionIssuelineWithMultipleSerialNumbers(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 ProductionIssue entity is available from product update 405 onwards.
Document Number: 26.158.238
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.