Solved

Failed to read binary data from database


Userlevel 1
Badge +6

Hi,

I am trying to send additional documents with the mail of the order using the topicAdd Purchase Order Attachments to the Same Email , When Print Order Unfortunately, I get the following error message.

"Failed to read binary data from database: Entity instance not found. (DOCUMENT_FILE_DATA - DOC_CLASS=TECHN-TSPEC, DOC_NO=1250234, DOC_SHEET=1, DOC_REV=A1, DOC_TYPE=VIEW, FILE_NO=1.0)
Caused by: ifs.fnd.base.SystemException: Failed to read binary data from database: Entity instance not found. (DOCUMENT_FILE_DATA - DOC_CLASS=TECHN-TSPEC, DOC_NO=1250234, DOC_SHEET=1, DOC_REV=A1, DOC_TYPE=VIEW, FILE_NO=1.0)
Caused by: ifs.fnd.base.DatabaseException: Entity instance not found. (DOCUMENT_FILE_DATA - DOC_CLASS=TECHN-TSPEC, DOC_NO=1250234, DOC_SHEET=1, DOC_REV=A1, DOC_TYPE=VIEW, FILE_NO=1.0)"

All files in the folder are 0 kByte in size

Which right is missing?

Regards

André

icon

Best answer by Mathias Dahl 6 May 2022, 08:30

View original

5 replies

Userlevel 7
Badge +30

I cannot say what is wrong more than that, when you get “Entity instance not found”, it means the record you have specified does not exist.

For that hack to work, the documents needs to be stored in the database. Do you keep them there?

 

Userlevel 1
Badge +6

Hi @Mathias Dahl 

oh yes, that is the cause of the problem. The documents are in a share and not in the database. That's the problem when you just copy code and don't read it properly.
Is there an IFS function that can copy these documents from a share. I guess the procedure Batch_Transfer_Handler_Api can't do it?

Regards

André

Userlevel 7
Badge +30

@Andre Martin 

Some people have been able to use different methods in Batch_Transfer_Handler_API to get files from Shared and FTP repositories in order to do hacks like this. I don't recommend using that API since it's not meant for anything else than R&DO-provided functionality and we don't guarantee it's use for anything else than what "we" use it for ourselves (which is transferring files between document repositories). That doesn't stop people from using it though 😃 But it's on their own risk.
 

Userlevel 1
Badge +6

Hi @Mathias Dahl ,

 

Ok and what is the recommended way? 🤔

We have attached special data sheets and technical drawings to articles as documents to describe them better. These are to be sent automatically with an order.

The hack is the only way I found.

Regards

André

Userlevel 7
Badge +30

@ADAHU 

Ok and what is the recommended way? 🤔

There is none, I’m afraid, for your use case. And that is how it is for many use cases.

In general, the official way to get files in and out of Docman is via our middle tier and the APIs we have there.

Some details are documented here:

https://docs.ifs.com/techdocs/Foundation1/050_development/060_ifs_applications_business_components/110_DOCMAN_Development/010_ifs_file_transfer_service/default.htm

 

Reply