Reading BLOB information

8152

Active Member
Hello

Have you ever developed (or seen) a solution that reads file attachment information from a JDE Blob field (such as F00165) and essentially retrieves the file? In other words, a user saves a PDF file attachment as a media object. I am looking for a way to extract the file from the blob?

Is there a JDE business function to do this?

EOne Release: 9.1
EOne Tools Release: 9.1.4.6

Thank you

8152
 
JDE doesn't save the file in the F00165, it just saves either the path or the queue and file name. In terms of files uploaded through the web interface, these will be saved to the HTML Upload queue path. Access is performed by the JAS server and not the enterprise server using either FTP or SMB access. In what context do you need access to this file?

Disclaimer: these statements are true for your tools release. Tools 9.2.1.0 changes the ROE.
 
We have a commercial product for these tasks - One Attachment Manager, if you are interested.
 
Hi 8152,

If you want to read BLOB field of F00165, we can write a custom C function using jdeGTGet_GenericTextKeyStr , because we have lot of API to manage BLOB fields.
 
Just have a look at how other C++ BSFNs get and handle the text and clone the BSFNs.

Don't buy anything to do that, get under the covers yourself. Alex, come on. Help the guy rather than sell stuff.

I hope this helps...and it's free

jdeGTGet_GenericText/ jdeGTGet_GenericTextKeyStr
Last Modified: B9 | March 14, 2017
This function will retrieve the text record type from the Media Object table (F00165). Once the record(s) is retrieved, the RTF text is converted to plain text.
Syntax
JDERTN(JDEDB_RESULT) JDEWINAPI jdeGTGet_GenericText (
PJSTR szObjectName,
LPVOID lpMODSKey,
int nSeq,
LPMODATA pMOData,
long lTotalRec);
JDERTN(JDEDB_RESULT) JDEWINAPI jdeGTGet_GenericTextKeyStr(
PJSTR szObjectName,
PJSTR pszMOKeyStr,
int nSeq,
LPMODATA pMOData,
long lTotalRec);
Parameters
Parameter Notes Usage
szObjectName Input/Required GT data structure name Primary unique key
lpMODSKey Input/Required GT data structure with valid data. The data within the GT data structure will be formatted into a string used for TXKY
pszMOKeyStr Input/Required Formatted string used for TXKY
nSeq Input
pMOData Output Array of data structure that store the data to be deleted.
lTotalRec Output Indicate number of array element exists in pMOData
Return Value
Return Value Description
JDEDB_PASSED Return value if this API succeeds
JDEDB_FAILED Return value if this API fails
Example
Sample #1:


JDEDB_RESULT JDBReturn = JDEDB_PASSED;
LPMODATA pMOData = NULL;
long lTotalRec = 0;

JDBReturn = jdeGTGet_GenericTextKeyStr (_J(“ABGT”), _J(“1”), 0, &pMOData, &lTotalRec);
if (JDBReturn == JDEDB_PASSED && pMOData && lTotalRec > 0)
{
jdeGTDelete_TextKeyStr(_J(“ABGT”) , _J(“1”), pMOData, lTotalRec);
jdeFreeMOData(pMOData, lTotalRec);
}

return;

Sample #2:


JDEDB_RESULT JDBReturn = JDEDB_PASSED;
LPMODATA pMOData = NULL;
long lTotalRec = 0;
DSABGT dsABGT = {0};

ParseNumericString(&dsABGT.mnAddressNumber, _J(“1”));

JDBReturn = jdeGTGet_GenericText(_J(“ABGT”), &dsABGT, 0, &pMOData, &lTotalRec);
if (JDBReturn == JDEDB_PASSED && pMOData && lTotalRec > 0)
{
jdeGTDelete_Text(_J(“ABGT”) , &dsABGT, pMOData, lTotalRec);
jdeFreeMOData(pMOData, lTotalRec);
}

return;


Additional Notes
• MODATA (or LPMODATA) Data Structure definition:
MODATA, *LPMODATA

Data Type Data Description Note
int nSeq Sequence number from MOSEQN
MOTYPE nMOType Media Object Type
JCHAR szUser[11] User name
JDEDATE jdDate Date updated
MATH_NUMERIC mnTime Time updated
BOOL bRTFData TRUE = RTF Text
FALSE = Plain Text or others
JCHAR szItemName[GT_ITNMSIZE] Item name
JCHAR szQueueName[GT_QUESIZE]
JCHAR szFileName[GT_FILESIZE]
PJSTR pData Allocate memory for text and shortcut media object type.

• MOTYPE definition:

DEFINE TYPE NOTE
OBJ_JDEALL All Media Object Types
OBJ_RTFTEXT Text Media Object
OBJ_JDEIMAGE Image Media Object
OBJ_JDEOLE OLE Media Object
OBJ_MISCJDESHORTCUT Shortcut Media Object
OBJ_MISCIMAGEVENDOR Third party vendor
OBJ_MISCHTML HTML/URL/File Media Object


See Also
Related API’s Description
jdeGTGet_GenericText/ jdeGTGet_GenericTextKeyStr Retrieve text record type and convert any RTF text to plain text
jdeGTGet_RTFText/ jdeGTGet_RTFTextKeyStr Retrieve text record type and and leave RTF text as is.
jdeGTGet_ImageKey/
jdeGTGet_ImageKeyStr Retrieve image record type
jdeGTGet_OLE/
jdeGTGet_OLEKeyStr Retrieve OLE record type
jdeGTGet_Shortcut/
jdeGTGet_ShortcutKeyStr Retrieve shortcut record type
jdeGTGet_Vendor/
jdeGTGet_VendorKeyStr Retrieve vendor record type
jdeGTGet_HTML/
jdeGTGet_HTMLKeyStr Retrieve HTML record type
jdeGTGet_AllMOType/
jdeGTGet_AllMOTypeKeyStr Retrieve ALL Media Object type based on OBNM and TXKY
jdeGTAddUpdate_Text/
jdeGTAddUpdate_TextKeyStr Update/Add the Media object record(s) of Text type
jdeGTAddUpdate_Image/ jdeGTAddUpdate_ImageKeyStr Update/Add the Media object record(s) of Image type
jdeGTAddUpdate_OLE/ jdeGTAddUpdate_OLEKeyStr Update/Add the Media object record(s) of OLE type
jdeGTAddUpdate_Shortcut/ jdeGTAddUpdate_ShortcutKeyStr Update/Add the Media object record(s) of Shortcut type
jdeGTAddUpdate_Vendor/ jdeGTAddUpdate_VendorKeyStr Update/Add the Media object record(s) of Third party type
jdeGTAddUpdate_HTML/
jdeGTAddUpdate_HTMLKeyStr Update/Add the Media object record(s) of HTML/URL type
jdeGTAddUpdate_AllMOType/
jdeGTAddUpdate_AllMOTypeKeyStr Update/Add the Media object record(s) of ALL type
jdeGTAddUpdate_AllMOTypeWithLang Update/Add the Media object record(s) of ALL type with language
jdeGTDelete_Text/ jdeGTDelete_TextKeyStr Delete specific text record type.
jdeGTDelete_AllText/ jdeGTDelete_AllTextKeyStr Delete all text record types for OBNM and TXKY
jdeGTDelete_Image/ jdeGTDelete_ImageKeyStr Delete specific image record type.
jdeGTDelete_AllImage/ jdeGTDelete_AllImageKeyStr Delete all image record types for OBNM and TXKY
jdeGTDelete_OLE/ jdeGTDelete_OLEKeyStr Delete specific OLE record type.
jdeGTDelete_AllOLE/ jdeGTDelete_AllOLEKeyStr Delete all OLE record types for OBNM and TXKY
jdeGTDelete_Shortcut/ jdeGTDelete_ShortcutKeyStr Delete specific Shortcut record type.
jdeGTDelete_AllShortcut/ jdeGTDelete_AllShortcutKeyStr Delete all Shortcut record types for OBNM and TXKY
jdeGTDelete_Vendor/ jdeGTDelete_VendorKeyStr Delete specific Vendor (Third Party) record type.
jdeGTDelete_AllVendor/ jdeGTDelete_AllVendortKeyStr Delete all Vendor (Third Party) record types for OBNM and TXKY
jdeGTDelete_HTML/ jdeGTDelete_HTMLKeyStr Delete specific HTML/URL record type.
jdeGTDelete_AllHTML/ jdeGTDelete_AllHTMLKeyStr Delete all HTML/URL record types for OBNM and TXKY
jdeGTDelete_AllMOType/ jdeGTDelete_AllMOTypeKeyStr Delete all record types for OBNM and TXKY
jdeValidateGTExist/ jdeValidateGTExistWithKeyStr Validate if Media Object exist in F00165 table
jdeGTGetCount/ jdeGTGetCountKeyStr Get total number of the media object
jdeGTFreeMOData Free the memory allocated for MODATA structure
 
Last edited:
This is my text above in .doc format
 

Attachments

  • jdeGTGet_GenericText.doc
    67.5 KB · Views: 244
Actually Alex's tools are great.
Buying a solution can be better than rolling your own.
It all depends on your available time, experience, and resources.
 
Actually Alex's tools are great.
Buying a solution can be better than rolling your own.
It all depends on your available time, experience, and resources.

I agree except for I would say "It all depends on..." what you are trying to do.

We own and use Alex's product for an interface written outside of the JDE toolset to an external (non-JDE) system - at the time it was the easiest way to implement that interface. However, I would not and do not use this product when working with attachments within the JDE toolset, and I wouldn't use it for what the user is describing (essentially using the attachment mechanic in JDE to act as a file upload UI), I would use the Oracle provided APIs listed by John.

To use Alex's product within JDE you would end up doing more work and have a more complicated configuration than if you simply used the APIs provided by Oracle.
 
I use his products too and some are free, which is great.

I'd rather a response like there are APIs to do this and here's the name and an example...however if you don't feel confident having a go yourself we sell X Y Z.
Rather than the constant we sell something to help you.

This is a forum for helping JDE minded people. Surely?

It's just the way I've been brought up. To help others rather than yourself all the time.
 
Last edited:
It's my way of helping JDE users. I think that most would rather avoid grizzly technical details and are looking for ready solutions.
 
Hello all

Thank you very much for your help. John, thank you for the documentation. I will spend 2 -3 days to read the documentation and see if I can figure this out.
We want to read F00165 and get the path to PDF attachment. Then I retrieve the PDF attachment and send the attachment via email message.

Again, thank you very much for your help. I got a lot of information I did not know.

8152
 
Back
Top