Why No Data Directive Trigger after uBAQ

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

As far as I notice, DD are also triggering on .Update method
image

Check the trace, and find out the right method, use that method and move your stuff to Method D.

Other experts can suggest further on this !

Updatable BAQ uses UpdateExt method on the relevant BO

image

Have you considered the Counter Sale order type? This type implies that the “shipment” occurs upon completion of the order entry. It creates the packer and marks it shipped.

You can also enable auto invoice so that after along with automatically creating the packer, the invoice is automatically created too.

Thanks 24x7,
I’m using the correct method to update the shipment, but the Ready to invoice flag is difficult to set in Customer Shipment.

thanks,
The odd thing is when I update the flag through the BAQ Designer, it works.
When I execute the same steps via code from OrderHed, it creates the correct data but does not trigger the DD of ShpHead and InvcHead. It somehow doesn’t make sense

Thanks Calvin,
The reason for this mod is we wat ot get rid of Epicor Counter Sale as it is too ridgit and slow.
Customer is at the counter, want’s to take what is available and leave the rest on backorder, doesn’t work with Counter Sale, you can only add whats available.
We’re using Auto Invoice anyway, that’s the other strnage thing, my mod triggers the invoice creation, but although ERS is a blackbox the trigger on InvcHead does not occur???

1 Like

this is what i suggest, use the UpdateExt method directive on ShipHead and InvcHead and see