One moment please...
Untitled Document

How-to: Consume ProductionIssue entity

General

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:

  • RetrieveSet — Return a set of records of production issue lines for you to perform a production issue.
  • Retrieve — Retrieve a single record of production issue line for you to perform a production issue.
  • Create — Save the production issue line to a temporary table with a transaction key. There is no data validation at this stage, the system will only check for mandatory fields (exists). The line will not be process until the Update action is performed.
  • Update — Process the production issue lines with the same transaction key. Actual fulfillment lines will be created. Standard production issue validation will be performed at this stage. The extra budget lines will be created for the production order if there is extra quantity or extra lines.

Properties

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

Mandatory field (Long)

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

 

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.

IsFractionAllowedItem

 

Read only field (Boolean True/False)

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

 

Read only field (Boolean True/False)

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)

 

Read only field (String)

This field indicates the description of the production issue line’s item.

ItemType

 

Read only field (String)

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

 

Read only field (String)

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

 

Mandatory field (String)

This field indicates the production order that needs to be issued.

This field is mandatory for the Create and Update actions.

RealizedQuantity

 

Read only field (Double)

This field indicates the quantity of item that has been issued in the production order for this planned production issue line.

Resource

 

Mandatory field (String)

This field must be provided with a valid resource ID upon performing the Create action.

SerialBatchNumber

 

Optional field (String)

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

 

Read only field (Double)

This field shows the step value of the planned issue line.

ToBeRealizedQuantity

 

Read only field (Double)

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

 

(Available since PU406)

 

Read only field (String)

The field indicates the unit for the quantity in the production issue line.

This unit refers to the item’s sales unit.

Sysguid

 

Read only field (String)

The field indicates the sysguid of the planned production issue line.

Modified

 

Read only field (String)

The field indicates the last modified date of the planned production issue line.

Warehouse

 

Mandatory field (String)

This field indicates the warehouse location of the item issued. The warehouse rights will be validated.

This field must be provided when performing the Create action.

How do I create production issue with entity?

To create a production issue with the ProductionIssue entity, user should consume the entity in the following sequence:

  1. Retrieve the planned production lines for issued with RetrieveSet (entities).
  2. Retrieve each single production issue with entity retrieve action.
  3. Enter the actual issue quantity and also provide the transaction key.
  4. Perform the entity Create action.
  5. Repeat steps 2 - 4 for each production issue line (* with the same transaction key).
  6. Perform the entity Update action.
  7. Capture the error in case there is any error thrown due to incorrect data when processing the production issue.

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.

How do I create production issue with serial items?

Method 1: Multiple (same ID) planned production issue line with different number

  1. Retrieve each single production issue with entity retrieve action.
  2. Check if IsSerialItem is true.
  3. Copy the production issue line.
  4. Assign serial number to SerialBatchNumber field and assign 1 to ActualQuantity.
  5. Perform the entity Create action.
  6. Repeat steps 3 - 5 until all ToBeRealizedQuantity.
  7. Perform the entity Update action.
  8. Capture the error in case there is any error thrown due to incorrect data when processing the production issue.

 

Method 2: Single planned production issue line with different number (as a string)

  1. Retrieve each single production issue with entity retrieve action.
  2. Check if IsSerialItem is true.
  3. Assign all serial numbers to SerialBatchNumber as a string with “,” as delimiter.
  4. Assign total serial numbers quantity to ActualQuantity.
  5. Perform the entity Create action.
  6. Perform the entity Update action.
  7. Capture the error in case there is any error thrown due to incorrect data when processing the production issue.

 

Examples

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

 

End Function

 

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

 

Try

_Client.Create(ent)

 

Catch ex As Exception

Throw

End Try

End Sub

 

Step 4: Process production issue

Private Sub ProcessProductionIssue (ByVal ID As String, ByVal ProductionOrder As String, ByVal TranKey As String)

 

Dim ent As New EntityData

'Dim client As New EntityClientEG(_Service, "(local)\sql2008r2", "399")

 

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 = "TransactionKey", .Value = TranKey})

End With

 

Try

_Client.Update(ent)

 

Catch ex As Exception

Throw

End Try

 

End Sub

 

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

End Sub

 

 

Method 1: Multiple (same ID) planned production issue line with different number

Private Sub CreateMultipleProductionIssuelinesWithMultipleSerialNumbers(ByVal ID As String)

Dim p As New NamedPropertyCollection(Of PropertyData)

Dim ent As EntityData

 

p.Add(New PropertyData() With {.Name = "ID", .Value = ID})

 

Try

ent = _Client.Retrieve(New EntityData With {.EntityName = _EntityName, .Properties = p})

 

If ent IsNot Nothing Then

Dim TranKey As String = Guid.NewGuid().ToString

 

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

_Client.Create(ent)

Next

'Process the lines

ProcessProductionIssue(0, ent.Properties("ProductionOrder").Value, TranKey)

End If

End If

 

Catch ex As Exception

Throw

End Try

 

End Sub

 

 

Method 2: Single planned production issue line with different number (as a string)

Private Sub CreateSingleProductionIssuelineWithMultipleSerialNumbers(ByVal ID As String)

Dim p As New NamedPropertyCollection(Of PropertyData)

Dim ent As EntityData

 

p.Add(New PropertyData() With {.Name = "ID", .Value = ID})

 

Try

ent = _Client.Retrieve(New EntityData With {.EntityName = _EntityName, .Properties = p})

 

If ent IsNot Nothing Then

Dim TranKey As String = Guid.NewGuid().ToString

Dim serialNumber As New List(Of String)

 

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

serialNumber.Add(String.Concat("Serial", i))

Next

 

ent.Properties("SerialBatchNumber").Value = String.Join(",", serialNumber.ToArray())

ent.Properties("ActualQuantity").Value = ent.Properties("ToBeRealizedQuantity").Value

ent.Properties("TransactionKey").Value = TranKey

_Client.Create(ent)

 

'Process the lines

ProcessProductionIssue(0, ent.Properties("ProductionOrder").Value, TranKey)

End If

End If

 

Catch ex As Exception

Throw

End Try

End Sub

 

Supported release

The ProductionIssue entity is available from product update 405 onwards.

Related documents

 

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.


Attachments
How to consume Production Issue Entity.docx 45.6 KB View Download
ProductionRealizationEntityTestApp.zip 282.0 KB Download