E9.2 Using JDB_SelectMediaObjectFile

travtone

Member
Hi Everyone...

My apologies if I sound ignorant to this, but I am. I just don't know much. However, I was trying my hand with my very limited knowledge of C and tried to use the API listed in the subject.

I was able to write a C function to call the JDB_SelectMediaObjectFile for selecting a record from F98MODAT. This works great on a Fat Client via Object Browser testing the function OR within an custom Interactive Application that I've simply added a button to that calls the function and running LOCAL WEB via OMW from my fat client. However, it does not work from the JDE WEB. It has been built and deployed to the PY environment I am testing this all in.

Using API Definition - DB_RTN (JDEDB_RESULT) JDEWINAPI JDB_SelectMediaObjectFile(HUSER hUser, JCHAR *szQueueName, JCHAR *szFileName, JCHAR *szTargetFileName);

Example. I am passing the following -

For szQueueName

" "

For szFileName -

\\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

For szTargetFileName -

\\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

The above when ran locally on my Fat Client via locally from LOCAL WEB or Object Browser with a path defined as C:\Test\Test2.jpg and it created the file is put into in folder on the local disk like I had expected. It also works with the above path on the network \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg when running locally from LOCAL WEB or Object Browser. However, having the same path C:\Test\Test2.jpg or \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg defined in the IV but calling from JDE WEB, it will not put the file in either location; I assumed it wouldn't on the local machine but I figured it should or would on the file server. How can this work if being called from the WEB? I had our CNC capture logs but it has nothing in there that looks helpful; like a permissions issue. I am so lost here. Any help would be greatly appreciated it. Thank you.

1661209968890.png
 
You shouldn't hard code the the queue. I would pass in what every is stored in F00165.QUNAM. That's probably not the issue, but good practice just in case its different when used elsewhere. I use this and it works great everywhere its run. When you test on the DV web client does it work?

Is your enterprise server a windows box or a 400?
 
Is that BSFN correctly deployed to your server?
Is the network folder location you are using mapped to your server and does the E1 user account have access to it?
 
Hi you guys.. Thank you for your replies. I am definitely passing the QUNAM via a data structure parameter so it will always be dynamic. I am trying to write this to use with DSI MEP. In any case, I was able to get this all working. The issue was I was trying to run the function and it write to a windows network share folder when our Enterprise Server is an AS400. On the fat client running this locally via localweb or from Object browser, I can pass the following parameters as -

Using F98MODAT.ZUGTFILENM via the API szFileName as \\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

and then for -

szTargetFileName - \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

And that works putting this into a windows network share folder. It takes the F98MODAT.ZUGTFILENM and extracts the file Test2.jpg into the windows network share folder \\Server\jde\E812\MEDIAOBJ\Test\

However, when it runs via the WEB, it will only work when writing to an IFS not a windows network share folder; no clue why. So now that I have the IFS in place on the AS400, it works from the WEB. Now my issue is how to copy the file from IFS to a Windows Share. :)

Thank you again..
Travis
 
Hi you guys.. Thank you for your replies. I am definitely passing the QUNAM via a data structure parameter so it will always be dynamic. I am trying to write this to use with DSI MEP. In any case, I was able to get this all working. The issue was I was trying to run the function and it write to a windows network share folder when our Enterprise Server is an AS400. On the fat client running this locally via localweb or from Object browser, I can pass the following parameters as -

Using F98MODAT.ZUGTFILENM via the API szFileName as \\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

and then for -

szTargetFileName - \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

And that works putting this into a windows network share folder. It takes the F98MODAT.ZUGTFILENM and extracts the file Test2.jpg into the windows network share folder \\Server\jde\E812\MEDIAOBJ\Test\

However, when it runs via the WEB, it will only work when writing to an IFS not a windows network share folder; no clue why. So now that I have the IFS in place on the AS400, it works from the WEB. Now my issue is how to copy the file from IFS to a Windows Share. :)

Thank you again..
Travis
Yep, those 400s make life a little more challenging. Some people like them. I hate working with a 400. Everything I want to do it so much more difficult. :)
 
I am finding that out.. I'm still green when it comes to dev work. Hopefully I can find some kind of resolution or work around. I appreciate your reply/help.
 
our work around was to setup an additional enterprise server using a windows box. Any functions that have to access network resources is run on that box. Made my life lots easier as a developer.
 
Hi Everyone...

My apologies if I sound ignorant to this, but I am. I just don't know much. However, I was trying my hand with my very limited knowledge of C and tried to use the API listed in the subject.

I was able to write a C function to call the JDB_SelectMediaObjectFile for selecting a record from F98MODAT. This works great on a Fat Client via Object Browser testing the function OR within an custom Interactive Application that I've simply added a button to that calls the function and running LOCAL WEB via OMW from my fat client. However, it does not work from the JDE WEB. It has been built and deployed to the PY environment I am testing this all in.

Using API Definition - DB_RTN (JDEDB_RESULT) JDEWINAPI JDB_SelectMediaObjectFile(HUSER hUser, JCHAR *szQueueName, JCHAR *szFileName, JCHAR *szTargetFileName);

Example. I am passing the following -

For szQueueName

" "

For szFileName -

\\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

For szTargetFileName -

\\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

The above when ran locally on my Fat Client via locally from LOCAL WEB or Object Browser with a path defined as C:\Test\Test2.jpg and it created the file is put into in folder on the local disk like I had expected. It also works with the above path on the network \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg when running locally from LOCAL WEB or Object Browser. However, having the same path C:\Test\Test2.jpg or \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg defined in the IV but calling from JDE WEB, it will not put the file in either location; I assumed it wouldn't on the local machine but I figured it should or would on the file server. How can this work if being called from the WEB? I had our CNC capture logs but it has nothing in there that looks helpful; like a permissions issue. I am so lost here. Any help would be greatly appreciated it. Thank you.

View attachment 19379
Could you please share the business function you write for the same?
 
Hi Everyone...

My apologies if I sound ignorant to this, but I am. I just don't know much. However, I was trying my hand with my very limited knowledge of C and tried to use the API listed in the subject.

I was able to write a C function to call the JDB_SelectMediaObjectFile for selecting a record from F98MODAT. This works great on a Fat Client via Object Browser testing the function OR within an custom Interactive Application that I've simply added a button to that calls the function and running LOCAL WEB via OMW from my fat client. However, it does not work from the JDE WEB. It has been built and deployed to the PY environment I am testing this all in.

Using API Definition - DB_RTN (JDEDB_RESULT) JDEWINAPI JDB_SelectMediaObjectFile(HUSER hUser, JCHAR *szQueueName, JCHAR *szFileName, JCHAR *szTargetFileName);

Example. I am passing the following -

For szQueueName

" "

For szFileName -

\\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

For szTargetFileName -

\\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

The above when ran locally on my Fat Client via locally from LOCAL WEB or Object Browser with a path defined as C:\Test\Test2.jpg and it created the file is put into in folder on the local disk like I had expected. It also works with the above path on the network \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg when running locally from LOCAL WEB or Object Browser. However, having the same path C:\Test\Test2.jpg or \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg defined in the IV but calling from JDE WEB, it will not put the file in either location; I assumed it wouldn't on the local machine but I figured it should or would on the file server. How can this work if being called from the WEB? I had our CNC capture logs but it has nothing in there that looks helpful; like a permissions issue. I am so lost here. Any help would be greatly appreciated it. Thank you.

View attachment 19379
Hi travtone, We have a very similar request. Would really appreciate if you could please share your bsfn code?
 
Hi Everyone...

My apologies if I sound ignorant to this, but I am. I just don't know much. However, I was trying my hand with my very limited knowledge of C and tried to use the API listed in the subject.

I was able to write a C function to call the JDB_SelectMediaObjectFile for selecting a record from F98MODAT. This works great on a Fat Client via Object Browser testing the function OR within an custom Interactive Application that I've simply added a button to that calls the function and running LOCAL WEB via OMW from my fat client. However, it does not work from the JDE WEB. It has been built and deployed to the PY environment I am testing this all in.

Using API Definition - DB_RTN (JDEDB_RESULT) JDEWINAPI JDB_SelectMediaObjectFile(HUSER hUser, JCHAR *szQueueName, JCHAR *szFileName, JCHAR *szTargetFileName);

Example. I am passing the following -

For szQueueName

" "

For szFileName -

\\Server\JDE\E812\MEDIAOBJ\HTMLUpload\FILE-172-16-12-159-5565749002928073-1661016021543.jpg

For szTargetFileName -

\\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg

The above when ran locally on my Fat Client via locally from LOCAL WEB or Object Browser with a path defined as C:\Test\Test2.jpg and it created the file is put into in folder on the local disk like I had expected. It also works with the above path on the network \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg when running locally from LOCAL WEB or Object Browser. However, having the same path C:\Test\Test2.jpg or \\Server\jde\E812\MEDIAOBJ\Test\Test2.jpg defined in the IV but calling from JDE WEB, it will not put the file in either location; I assumed it wouldn't on the local machine but I figured it should or would on the file server. How can this work if being called from the WEB? I had our CNC capture logs but it has nothing in there that looks helpful; like a permissions issue. I am so lost here. Any help would be greatly appreciated it. Thank you.

View attachment 19379
Hi Travis, Will it be possible for you to share the .c file of this BSFN? We have a request which is in line with what you have done.

-NP
 
Back
Top