MEdia Object

gigi

gigi

VIP Member
Hi guy,
did anyone try to manage (Insert, update..) Media Object with Event Rules. I have to manage Media Object without open the attachement screen. Is it possible?
Thanks in advance.
Gigi
 
Gigi,

What is your system configuration ? that can help many of us to help you.

I think that one of my old post can help you, so take a look in the archive and see if you can use it.

ARCHIVE :
christian_audet
6/7/01 12:14 PM

Tell me if you need more explanation because we did a lot of Media Object Insert with up to 2000 caracters each without any problem.

Christian Audet

*** SHARED KNOWLEDGE = BETTER KNOWLEDGE ***

Implementing B7333 (Xe) SP16.1, SQL
(Support B732, B7331 and B7332)
 
Hi Christian,
my configuration is:

OW XE SP18_B1 / Oracle 8.1.7
WTS 2000 / Client 2000

Christian, I don't find your post about Media Object, can you help me? Thanks

Gigi
 
Hi List, at first thank you for check my question.

We are doing a UBE for conversion from text file to F4201 and F4211 throw
the Z1 files, our trouble is how to manage / convert remarks (TXVC fields)
in Media Objects.
I found an old post from " ARCHIVE :christian_audet 6/7/01 12:14 PM"
but in our configuration we dont have the object "Call Business Funtio
ConvertNarrativeText (B0500047) " could anyone help us with some ideas ?

Thanks in advance!
Carlos
B732, NT, SQL
 
I don't know of a way to do this in ER, but to do it in a C function is quite simple.

This is how you can copy a media objects data from one place to another. . .

Create a DSTR for the function that has the COPY FROM and COPY TO key for your media object.

In the C code, call the API that retrieves the media object(use the COPY FROM key), now just call the API that writes the new media object (use the COPY TO key).

Something like this. . . .:

************************************
// declarations
DSGT55005 dsGT55005; //The FROM KEY
DSGT55006 dsGT55006; //the TO KEY
LPSTR pGenericText = (LPSTR)NULL;

// move the key fields
memcpy(&dsGT55005.mnAddressNumber, &lpDS->blah blah blah
memcpy(&dsGT55005.mnDocumentOrderInvoiceE, &lpDS->blah blah blah
memcpy(&dsGT55005.szOrderType, lpDS->blah blah blah
memcpy(&dsGT55005.szCompanyKeyOrderNo, lpDS->blah blah blah

// get the FROM KEY media object using this API:
pGenericText = GetGenericText("GT55005",(ID)0, &dsGT55005, TRUE);
if(pGenericText==NULL)
return(ER_ERROR);


// your FROM KEY media object is now 'in' pGenericText


// move the key fields for your TO KEY
memset ((void *)(&dsKey55006), (int)('\0'), sizeof(dsKey55006));
memcpy(&dsGT55006.mnAddressNumber, &lpDS->blah blah blah
memcpy(&dsGT55006.mnDocumentOrderInvoiceE, &lpDS->blah blah blah
memcpy(&dsGT55006.szOrderType, lpDS->blah blah blah
memcpy(&dsGT55006.szCompanyKeyOrderNo, lpDS->blah blah blah

// insert to your new media object with this API:
// This does inserts too, not just updates.
idJDEDBReturn = ModifyGenericTextName ((LPSTR)"GT55006",(LPVOID)&dsKey55006,(LPSTR)pGenericText);
************************************

Tada! That's almost all the code there is. The rest is left as an exercise for the student ;)

Darren Ricciardi - OneWorld Whipping Boy

Looking for work WEST of DENVER
 
;)
Thanks, Darren Ricciardi - OneWorld Whipping Boy
I´ll follow your instruction

good luck,
Carlos
 
Back
Top