aaguiar
8th July 2004, 21:48
Hello personal,

Somebody, has an example of exclusion of a purchase order using AFS. I did him this turning off the order but the return of the delete is zero. and the message is the following: Unable to delete; record being used in other table.

If I make it manually I don't have any problem, besides in the debug of the program he goes by the same routines.

here this the piece of the code regarding exclusion.

f4101m000.put.purchase_order(tdgdc011.orno.o)
retFind = f4101m000.find ()
if retFind = 1 then
retMark = f4101m000.mark(errorMessage)
if retMark then
apagarOrdemCompra ()
endif
else
tdgdcdll0001.logErroInterface (" Empresa/Ordem: " &
str$(tdgdc011.ncmp.o) &" /" &
str$(tdgdc011.orno.o) & " non encotrada ")
errorCode = f4101m000.get.last.message.code ()
retRecover = f4101m000.recover (errorMessage)
endif
endif
function apagarOrdemCompra ()
{
| #Routines to turn off the purchase Order
retDelete = f4101m000.delete(true,errorMessage)
if not retDelete then
tdgdcdll0001.logErroInterface (" Mistake to Turn off Ordem/Empresa GDC: " &
str$(tdgdc011.orno.o) &" /" &
str$(tdgdc011.ncmp.o) &"" & errorMessage)
errorCode = f4101m000.get.last.message.code ()
retRecover = f4101m000.recover (errorMessage)
endif
}

mark_h
8th July 2004, 22:58
Is there code to delete any lines attached to the purchase order?

Mark

aaguiar
9th July 2004, 03:43
Yes Mark, the exists mark.delet event that calls the sub-session tdpur4803s000. Will it be that I need you invoke it with the handle process?

thanks

mark_h
9th July 2004, 20:27
Missed this post. Yes I would expect that you would need subsession in with a handle subprocess statement. From glancing at some old 4c3 code it looks like it imports some data.

Mark