PdcProductReport.ProcessReport: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
== Code example ==
== Code example ==
<source lang="vb">
<source lang="vb">
'Create a repair calculation
dim objReport
dim objReport


   set objReport = pdc.ProductRegistration.ProductReports.Open("250", True)
   set objReport = pdc.ProductRegistration.ProductReports.Open("250", True)
   if objReport.ProcessReport(0) then 'Herstel calculatie
   if objReport.ProcessReport(0) then
     objReport.Save
     objReport.Save
   else
   else
Line 27: Line 28:


<source lang="vb">
<source lang="vb">
 
'Create a new calculation
</source>
dim objReport
dim objReport


   set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
   set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
   if objReport.ProcessReport(1) then 'Nieuwe calculatie
   if objReport.ProcessReport(1) then  
     objReport.Save
     objReport.Save
   else
   else
     msgbox pdc.LastError
     msgbox pdc.LastError
   end if
   end if
</source>
<source lang="vb">
<source lang="vb">
'Do nothing
dim objReport
dim objReport



Revision as of 09:25, 17 July 2013

Declaration

ProcessReport(ProcessMethod as long) as Boolean

Description

This method settles a productreport with a specific applied process method.

Notes

Three different methods are defined:
0 = Create a repair calculation, which is a copy from the productreports calculation. After the calculation is created, it is shown. When the productreport doesn't have a calculation, the return value is false.
1 = Create a new calculation en show it.
2 = Do nothing, the productreport is only for registration.

Every process method does following things:
1. Turns a productreport into processed (Don't forget to save the product report).
2. If there raises any error, the return value is false and the error can be shown.

Code example

'Create a repair calculation
dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.Open("250", True)
  if objReport.ProcessReport(0) then
    objReport.Save
  else
    msgbox pdc.LastError
  end if
'Create a new calculation
dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
  if objReport.ProcessReport(1) then 
     objReport.Save
  else
    msgbox pdc.LastError
  end if
'Do nothing
dim objReport

  set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
  if objReport.ProcessReport(2) then
    objReport.Save
  else
    msgbox pdc.LastError
  end if

Availability