PdcProductReports.New: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 10: Line 10:
Note that reporting finished products is not fully implemented yet. It is expected in version 4.3 or onwards.
Note that reporting finished products is not fully implemented yet. It is expected in version 4.3 or onwards.


== Code example ==
== Code example VB.NET ==
This code example creates a new finished product report for productionorder 10200 (up to version 5.3).
<source lang="vb">
Dim aPR As PDCEXT.IProductReport = PDC.App.ProductRegistration.ProductReports.[New]
Dim QntyCalc As Double = 1
Dim QntyReady As Double = 1
 
  aPR.CalculationNumber = "10200"
  aPR.FinishedReport = True
  aPR.AllOpertionsReady = True
  If QntyReady >= QntyCalc Then
    aPR.InternalReady = True
  Else
    aPR.InternalReady = False
  End If
  aPR.ProductFinished = True
  aPR.Quantity = QntyReady
 
  If Not aPR.Save Then
    MsgBox(aPR.Error)
  End If</source>
 
== Code example VBScript ==
This code example creates a new finished product report for productionorder 10200 (up to version 4.3).
This code example creates a new finished product report for productionorder 10200 (up to version 4.3).


Line 32: Line 54:
<source lang="vb">
<source lang="vb">
dim objReport
dim objReport
dim dblQntyCalc
dim dblQntyReady


  dblQntyCalc = 1
  dblQntyReady = 1
   set objReport = pdc.ProductRegistration.ProductReports.New
   set objReport = pdc.ProductRegistration.ProductReports.New
   objReport.ProductionNumber  = "10200"   
   objReport.ProductionNumber  = "10200"   
   objReport.FinishedReport    = True
   objReport.FinishedReport    = True
   objReport.AllOpertionsReady  = True   
   objReport.AllOpertionsReady  = True   
   objReport.InternalReady      = True
   if dblQntyReady >= dblQntyCalc then
    objReport.InternalReady      = True
  else
    objReport.InternalReady      = False
  end if
   objReport.ProductFinished    = True
   objReport.ProductFinished    = True
   objReport.Quantity          = 1
   objReport.Quantity          = dblQntyReady


   if not objReport.Save then
   if not objReport.Save then
Line 46: Line 76:
</source>
</source>


This code example creates a new product report for productionorder 10200 operation line 10.
This code example creates a new product report for productionorder 10200 operation line 10 (up to version 4.3).


<source lang="vb">
<source lang="vb">
Line 57: Line 87:
   objReport.FinishedReport        = true
   objReport.FinishedReport        = true
   objReport.CurrentOperationReady = true
   objReport.CurrentOperationReady = true
  if not objReport.Save then
    msgbox objReport.Error
  end if
</source>
This code example creates a new product report for productionorder 10200 operation line 10 (From version 5.0).
<source lang="vb">
dim objReport
  set objReport = pdc.ProductRegistration.ProductReports.New
  objReport.ProductionNumber      = "10200" 
  objReport.LineNumber            = 10
  objReport.FinishedReport        = true
  objReport.CurrentOperationReady = true
  objReport.Quantity              = 1
   if not objReport.Save then
   if not objReport.Save then
     msgbox objReport.Error
     msgbox objReport.Error

Latest revision as of 08:35, 12 April 2018

Declaration

New as PdcProductReport

Description

Notes

This function return a new product report object. The product report object has two different reportstates, Report finished products or normal reports (of an operation). Note that reporting finished products is not fully implemented yet. It is expected in version 4.3 or onwards.

Code example VB.NET

This code example creates a new finished product report for productionorder 10200 (up to version 5.3).

Dim aPR As PDCEXT.IProductReport = PDC.App.ProductRegistration.ProductReports.[New]
Dim QntyCalc As Double = 1
Dim QntyReady As Double = 1

  aPR.CalculationNumber = "10200"
  aPR.FinishedReport = True
  aPR.AllOpertionsReady = True
  If QntyReady >= QntyCalc Then
    aPR.InternalReady = True
  Else
    aPR.InternalReady = False
  End If
  aPR.ProductFinished = True
  aPR.Quantity = QntyReady

  If Not aPR.Save Then
    MsgBox(aPR.Error)
  End If

Code example VBScript

This code example creates a new finished product report for productionorder 10200 (up to version 4.3).

dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.New
  objReport.ProductionNumber   = "10200"  
  objReport.AllOpertionsReady  = True  
  objReport.InternalReady      = True
  objReport.ProductFinished    = True
  objReport.Quantity           = 1

  if not objReport.Save then
    msgbox objReport.Error
  end if

This code example creates a new finished product report for productionorder 10200 (From version 5.0).

dim objReport
dim dblQntyCalc 
dim dblQntyReady

  dblQntyCalc = 1
  dblQntyReady = 1
  set objReport = pdc.ProductRegistration.ProductReports.New
  objReport.ProductionNumber   = "10200"  
  objReport.FinishedReport     = True
  objReport.AllOpertionsReady  = True  
  if dblQntyReady >= dblQntyCalc then
    objReport.InternalReady      = True
  else
    objReport.InternalReady      = False
  end if
  objReport.ProductFinished    = True
  objReport.Quantity           = dblQntyReady

  if not objReport.Save then
    msgbox objReport.Error
  end if

This code example creates a new product report for productionorder 10200 operation line 10 (up to version 4.3).

dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.New
  objReport.ProductionNumber      = "10200"
  objReport.Quantity              = 1
  objReport.LineNumber            = 10
  objReport.FinishedReport        = true
  objReport.CurrentOperationReady = true
  if not objReport.Save then
    msgbox objReport.Error
  end if

This code example creates a new product report for productionorder 10200 operation line 10 (From version 5.0).

dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.New
  objReport.ProductionNumber      = "10200"  
  objReport.LineNumber            = 10
  objReport.FinishedReport        = true
  objReport.CurrentOperationReady = true
  objReport.Quantity              = 1

  if not objReport.Save then
    msgbox objReport.Error
  end if

Availability

Available from version 4.0 onwards.