Dynamic Code (.NET SDK) schedule to close Production Orders
RespondidaI'm running some basic code in a Universal function to schedule closing of completed Production Orders. Whilst this code works perfectly in Visual Studio and test compiles OK in the Universal function, when it's run with the scheduler nothing happens.
No errors but no updated closed Production orders either?
SAP Version 9.2 PL 5
Boyum Version 2017.0.6.0
SAPbobsCOM.Recordset rs = (SAPbobsCOM.Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
rs.DoQuery(query);
{
int docEntry = (int) rs.Fields.Item("DocEntry").Value;
if (OWOR.GetByKey(docEntry))
{
OWOR.ProductionOrderStatus = SAPbobsCOM.BoProductionOrderStatusEnum.boposClosed;
int result = OWOR.Update();
string message = company.GetLastErrorDescription();
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(rs);
-
Comentario oficial
Hello David,
Since this is an advanced question, in this case you need to contact your local partner to obtain this support. Unfortunatelly we don't provide Dynamic Code support.
-
Solved
1. It's missing a line that raises an error when result <> 0, hence why no error.
2. Production Orders couldn't be updated because the user for the scheduler did not have authorization to the document series group.
-
Thanx, just what we needed. But I am not so familiar with .NET so I just copied and pasted your code, but I missed the code for the error handling. What do I need to complete the code with?
Iniciar sesión para dejar un comentario.
Comentarios
3 comentarios