himanshu wrote
put your last two lines into separate process, having input of invoices
FIND VAT WHERE (InvoicesLines.ps_VATpercent=VAT)
CREATE VATSummary FOR EACH VAT WITH VATSummary.VAT=VAT.Name, VATSummary.SUMVAT = SUM InvoicesLines.VATAmount WHERE (VAT=InvoicesLines.ps_VATpercent),VATSummary.InvoiceMaster=Invoices
Hey buddy. Hope you’re coming to FL.
While the concept of a subprocess is something that he was definitely not understanding yet,
I don’t think this is gonna work.
You said it’s an input of invoices.
But it Has to be an input of invoiceLlnes the way the first find is written.
If that’s the case, then it’s gonna call the subtask 4 times. And that’s going to create 4 summary lines.
This complexity is because we can’t do a find unique in aware anymore.
I can think of four ways to do this, but they’re all convoluted, or require a stored procedure, which is the ideal way to do it in my opinion.
But given what you have written, I don’t see how the create summary is going to execute only two times.
And because we cannot get the unique VAT values in the invoice lines file, easily, I don’t see how you can create a context in a parent to call this sub only two times.