Hi
I am looking for a script to update "Daily Sales Report/Updates" in sales order (sage100 v2021).
Could anyone suggest me what script i can use in BOI suing c# or VB?
Hi
I am looking for a script to update "Daily Sales Report/Updates" in sales order (sage100 v2021).
Could anyone suggest me what script i can use in BOI suing c# or VB?
int taskId = (int)oSS.InvokeMethod("nLookupTask", "SO_SalesJournal_ui");
oSS.InvokeMethod("nSetProgram", taskId);
object successCheck = 0;
successCheck = oSS.InvokeMethod("nSetDate", "S/O", "20220517");
if (successRefundCheck.ToString() == "0")
{
object errorMsg = oSS.GetProperty("sLastErrorMsg");
Console.WriteLine(("Error :- " + errorMsg.ToString());
}
try
{
using (DispatchObject salesPrint = new DispatchObject(pvx.InvokeMethod("NewObject", "SO_SalesJournal_upd", oSS.GetObject())))
{
successCheck = salesPrint.InvokeMethod("nSetPostingDate", "20220517");
if (successCheck.ToString() == "0")
{
object errorMsg = salesPrint.GetProperty("sLastErrorMsg");
Console.WriteLine(("Error :- " + errorMsg.ToString());
}
successCheck = salesPrint.InvokeMethod("nProcessReport", "DEFERRED");
if (successCheck.ToString() == "0")
{
object errorMsg = salesPrint.GetProperty("sLastErrorMsg");
Console.WriteLine(("Error :- " + errorMsg.ToString());
}
successCheck = salesPrint.InvokeMethod("nUpdate");
if (successCheck.ToString() == "0")
{
object errorMsg = salesPrint.GetProperty("sLastErrorMsg");
Console.WriteLine(("Error :- " + errorMsg.ToString());
}
else
{
Console.WriteLine("Sales invoice updated successfully " );
salesPrint.Dispose();
}
}
}
catch(Exception ex)
{
Console.WriteLine("Error while updating refund invoice "+ ex.Message);
}
Posting using Deferred is not recommended. You permanently bypass the Paperless Office PDF copy, which is incredibly valuable.
Hey Kevin Thank you for your response
Could you suggest me on this how can I setup paperless office pdf? As i am not aware of this
and do i need to set the nProcessReport("PRINT") ? after the paperless office pdf?
My advice is general, not related to scripting. I've never even used such a script before but did notice the reference to deferred.
(When we need to set up auto-posting, we use Sage Task Scheduler, as BigLouie mentioned... but Paperless Office is often difficult to get working properly in abnormal situations).
okay we'll give it a try Thank You!
okay we'll give it a try Thank You!
*Community Hub is the new name for Sage City