Skip to Content
0
Aug 29, 2008 at 12:38 PM

Can't close a draft document?

127 Views

Hi, I'm trying to close a draft document (return draft). Below is the code snippet:

Response.Write "Finding draft 2...<br />"
dim odraft
set odraft = oCompany.GetBusinessObject(odrafts)
if odraft.GetByKey(2) then 
	Response.Write "Found; contact = " & odraft.cardname & "<br />" 
else
	Response.Write "not found<br />"
end if

Response.Write "close draft 2...<br />"
if odraft.close() = 0 then 
	response.write "close ok<br>"
else
	Response.Write "can't close<br />"
	response.write ocompany.getlasterrorcode() & " "
	response.write ocompany.getlasterrordescription() & "<br>"
end if

And below is the output:

Finding draft 2...
Found; contact = ANTHONY M BENASSI
close draft 2...
can't close
-5006 The requested action is not supported for this object.

Did I do something wrong here?

Thanks.