I'm working on a Data directive (In Trans.) on the InvcTax table. It is supposed to look for the row being modified and change one field value from all the previous rows on the same table. The problem is that not only it doesn't change the value, but it 'deletes' the temp row it finds. It seems that for some reason that temp row is not able to persist after the change i'm doing. Has anyone done something similar? Here's the code:
find first ttInvcTax where (ttInvcTax.RowMod = 'A' or ttInvcTax.RowMod = 'U') and ttInvcTax.CollectionType = 1 exclusive-lock.
if available ttInvcTax then do:
for each InvcTax where ttInvcTax.Company = InvcTax.Company and ttInvcTax.InvoiceNum = InvcTax.InvoiceNum and InvcTax.CollectionType = 1 and InvcTax.InvoiceLine < ttInvcTax.InvoiceLine exclusive-lock:
if available InvcTax then do:
Run lib\UpdateTableBuffer.p(input BUFFER InvcTax:HANDLE, 'DocTaxAmt', 2111.99).
end.
end.
end.
Thanks,
DavidC
find first ttInvcTax where (ttInvcTax.RowMod = 'A' or ttInvcTax.RowMod = 'U') and ttInvcTax.CollectionType = 1 exclusive-lock.
if available ttInvcTax then do:
for each InvcTax where ttInvcTax.Company = InvcTax.Company and ttInvcTax.InvoiceNum = InvcTax.InvoiceNum and InvcTax.CollectionType = 1 and InvcTax.InvoiceLine < ttInvcTax.InvoiceLine exclusive-lock:
if available InvcTax then do:
Run lib\UpdateTableBuffer.p(input BUFFER InvcTax:HANDLE, 'DocTaxAmt', 2111.99).
end.
end.
end.
Thanks,
DavidC