Hi,
Below is a portion of code in the DeleteRecord routine. You will notice that the first call p_web.AddServiceError uses ERRORCODE and ERROR to indicate the reason of the delete error. But it seems as if the errorcode has been reset before this call, resulting in errorcode 0 to be returned here ("ERRORDESCRIPTION": "Error occured Deleting the record 0").
So it's important to catch the error before other calls are made. Also, if an error occurs using SQL then ERRORCODE only returns 90 (FileSystemError) which doesn't say much about the real error. You should use FILEERRORCODE to get the real reason. This type of statement helps a lot to get the correct description:
choose (errorcode () = 90, fileerror (), error ())
Thanks,
Thys
do QueueToFile:RequiredAttribute
If p_web.GetFile(RequiredAttribute,REQ:RequiredAttribute_PK) = 0
idString = 'REQ:GUID = ' & REQ:GUID
If p_web.sqlsync then p_web.SqlWait(p_web.SqlName).
err = p_web.DeleteFile(RequiredAttribute)
If p_web.sqlsync then p_web.SqlRelease(p_web.SqlName).
if Err = 0
p_web.AddServiceResult('Delete','RequiredAttribute',idString,'success')
Else
p_web.AddServiceError(Err,'dbRequiredAttribute', p_web.RecordIdentifier(RequiredAttribute), 'Error occured Deleting the record ' & errorcode() & ' '& error(), '')
End
Else
p_web.AddServiceError(Error:RecordNotFound,'dbRequiredAttribute', p_web.RecordIdentifier(RequiredAttribute), 'Record not found when attempting to do a Delete', '')
End