I’m giving up, hope someone can save my sanity.
I finally got my Auto Ship feature working, meaning shipping released order lines directly from order entry.
As described a few times in this forum (thanks for all the great ideas), the issue about creating a customer shipment is setting the ReadyToInvoice flag so that it triggers the related black box functions like updating order release and depleating stock.
In my case I used a uBAQ in my final code piece to set the flag, and it works perfectly, so I thought.
BUT, my common Data Directives for printing the Pack Slip and Invoice (ERS) don’t trigger???
When I only create the shipment but trigger ReadyToInvoice directly from the BAQDesigner, it works fine.
Comparing ShipHead and InvcHead shows exactly the same data.
Has anyone an idea what could cause the Data Directives not to trigger? I tried to use standard widgets to trigger the uBAQ but am struggling passing the ExecParam…
This is the code I’m using after creating the shipment from DD OrderHed.
Ice.Contracts.DynamicQuerySvcContract boDynamicQuery2 = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.DynamicQuerySvcContract>(Db);
Ice.Tablesets.QueryExecutionTableset dsQueryExecution2 = new QueryExecutionTableset();
string BAQName = “AW_ShipReadyToInvoice”;
//If the BAQ has Parameters
ExecutionParameterRow drRow2 = new ExecutionParameterRow();
drRow2.ParameterID = “PackNum”; // name of parameter from BAQ
drRow2.ParameterValue = Convert.ToString(headerPackNum);
drRow2.ValueType = “nvarchar”; // Always pass an nvarchar
drRow2.IsEmpty = false;
drRow2.RowMod = “A”;
drRow2.SysRowID = Guid.Empty;
dsQueryExecution2.ExecutionParameter.Add(drRow2);
DataSet dsResults2 = boDynamicQuery2.ExecuteByID(BAQName, dsQueryExecution2);
DataTable result_dt2 = dsResults2.Tables[“Results”];
if (dsResults2.Tables[0].Rows.Count>0)
{
dsResults2.Tables[0].Rows[0][“ShipHead_ReadyToInvoice”] = true;
}
boDynamicQuery2.UpdateByID(BAQName,dsResults2);
boDynamicQuery2.Dispose();
Any ideas?
Thanks in advance
Cheers
Andreas