PdcProductReport.ProcessReport: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
This method settles a productreport with a specific applied process method. | This method settles a productreport with a specific applied process method.<br /> | ||
Three different methods are defined: | == Notes == | ||
0 = Create a repair calculation, which is a copy from the productreports calculation. | Three different methods are defined:<br /> | ||
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.<br /> | |||
1 = Create a new calculation en show it.<br /> | |||
2 = Do nothing, the productreport is only for registration.<br /> | |||
<br /> | |||
Every process method does following things:<br /> | |||
1. Turns a productreport into processed (Don't forget to save the product report).<br /> | |||
2. If there raises any error, the return value is false and the error can be shown.<br /> | |||
== Code example == | |||
This code example creates a repair calculation from a productreport with ID = 251 | |||
<source lang="vb"> | |||
dim objReport | |||
== | set objReport = pdc.ProductRegistration.ProductReports.Open("251", True) | ||
if objReport.ProcessReport(0) then | |||
objReport.Save | |||
else | |||
msgbox pdc.LastError | |||
end if | |||
</source> | |||
This code example creates a new calculation from a productreport with ID = 251 | |||
<source lang="vb"> | |||
dim objReport | |||
= | set objReport = pdc.ProductRegistration.ProductReports.Open("251", True) | ||
if objReport.ProcessReport(1) then | |||
objReport.Save | |||
else | |||
msgbox pdc.LastError | |||
end if | |||
</source> | |||
This code example does not start a repairorder for productreport with ID = 251 | |||
<source lang="vb"> | <source lang="vb"> | ||
dim objReport | |||
set objReport = pdc.ProductRegistration.ProductReports.Open("251", True) | |||
if objReport.ProcessReport(2) then | |||
objReport.Save | |||
else | |||
msgbox pdc.LastError | |||
end if | |||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available from version 4.0 onwards. |
Latest revision as of 09:31, 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
This code example creates a repair calculation from a productreport with ID = 251
dim objReport
set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
if objReport.ProcessReport(0) then
objReport.Save
else
msgbox pdc.LastError
end if
This code example creates a new calculation from a productreport with ID = 251
dim objReport
set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
if objReport.ProcessReport(1) then
objReport.Save
else
msgbox pdc.LastError
end if
This code example does not start a repairorder for productreport with ID = 251
dim objReport
set objReport = pdc.ProductRegistration.ProductReports.Open("251", True)
if objReport.ProcessReport(2) then
objReport.Save
else
msgbox pdc.LastError
end if
Availability
Available from version 4.0 onwards.