Demo 9.1 Media Object Error Messaging (9.1.0.1)

rjcrock

Active Member
New JDE developer. I am working through a tutorial and attempting to display an error message when a record not found in a file.

I have created a type 'E' glossary item (594101) in the DD which states "Item not found in Item Master"
I have created the Media Object Data Structure containing mnItemNumber and szCostCenter.
On the form in question I have gone into Media Objects Setup and checked the "Enable automatic media object functionality", Media Objects Only, Row Level Default, and display mode. I have defined the "Row Key" as mnItemNumber and szCostCenter. In the form ER I used the following.
Media Object Structure(GT594104, <Default Media Object>, <Display>, "594101", VAgrd_szEverest EventPoint01_EV01, GCItemNumber, GCBusinessUnit.
I also tried Get Text instead of display but it returned nothing either.
I ran it through Debug but it just flows through the statement with no indication of success or failure.
Would anyone be able to point me in the right direction on this?

Note: In the tutorial (tutorial does not state what version it is based on) it shows a screen for Defining a Media Object Data Structure. The last two columns in that screen show "Required" and "Input/Output". In 9.1 these 2 fields do not show. Do I need to set these fields somewhere else?
 
You are missing some basic knowledge of how media objects are used in E1 and how to display errors to the user. The process you have explained will not work.

When you created the error message did you use the error message DD application or the standard DD application? To display the error you created use system function Set Control Error.

I am also interested in seeing the tutorial you are using. It seems a little wacky if it walked you down this path.
 
Yeah Scott is right about the error message.
There are a few ways to create a proper E1 error item

DD in the fast path and then click Error Messages
This is P92002 form W92002F
The message DD item then lives in your default OMW project (so you may need to move it later for promotion)


Or...

In the OMW project click ADD, DD item and then read that pop up message closely
smile.gif
Depending on what you click, you'll either create a new DD item to be used as a DSTR element and table column, OR what you want, a proper DD error message

As for determining the error in ER and in debug...

In debug, monitor System Variable SV Error Status for general errors
SV File IO Status is for table IO indications.

So to set your error, you can either try a select to F00165 on the key and GT you want (don't forget the pipe | in between your ITM and MCU) and then check for SV File IO

or use your system function and check the retrieved text is blank or not afterwards?

0008 // Construct TXKY with | in between the key fields
0009 VA frm_MediaObjectTextKey_TXKY = [GC SupplierNumber]
0010 VA frm_MediaObjectTextKey_TXKY = concat( [VA frm_MediaObjectTextKey_TXKY],'|' )
0011 VA frm_MediaObjectTextKey_TXKY = concat([VA frm_MediaObjectTextKey_TXKY],[VA evt_GCVendorInvoiceNumber])
0012 VA frm_MediaObjectTextKey_TXKY = concat( [VA frm_MediaObjectTextKey_TXKY],'|' )
0013 VA frm_MediaObjectTextKey_TXKY = concat([VA frm_MediaObjectTextKey_TXKY],[GC LineNumber])
0014 //
0015 VA evt_GTNameObject = "GT550411D"
0016 VA evt_MediaObjectLengthOfText = "0"
0017 F00165.Select
VA evt_GTNameObject = TK Object Name
VA frm_MediaObjectTextKey_TXKY = TK Generic Text Key
0018 F00165.Fetch Next
VA evt_MediaObjectLengthOfText <- TK Media Object - Length of Text
0019 //
0020 // Access Media Object Status (FC NaughtyYN ) = 1 when found 0 when NOT
0021 If VA evt_MediaObjectLengthOfText is greater than <Zero>
0022 FC naughty YN = "G"
0023 Access Media Object(<Default Media Object>, GT550411D, VA frm_MediaObjectTextKey_TXKY, <Edit>, FC naughty YN, <First Text Item>)
0024 Else
0025 FC naughty YN = "N"
0026 Access Media Object(<Default Media Object>, GT550411D, VA frm_MediaObjectTextKey_TXKY, <Edit>, FC naughty YN, <First Text Item>)
0027 End If


But this is only checking for MO text linked to that item
You need to check F4101 for your ITM and set an error on a field of your choiceb using the system function listed above
 
First of all, thanks for your reply. Greatly appreciated!
Yes, I did use the error message DD. I used the Set Control Error function as you suggested and it worked as designed.

Regarding the tutorial, some of it is tutorial, and some of it is instructor led. Of course the instructor led stuff is missing since I have no instructor
smile.gif
, so I am in the dark at times for portions of the course.
 
Thank you also for your reply. I did find the DD item living in my default OMW project.

I used the system function Set Control Error as you an Scott suggested and this worked. I am thinking that with this method I don't need a media object data structure?

I didn't really follow the the stuff with F00165. I understood the concat, the select and fetchnext but I couldn't find the Access Media Object function and also, when I looked in F00165 I didn't see GT594104 (the DS that I created)and I thought it might be here.

In any case you guys got me past this so Thanks again.
 
Nope, you don't need the media object data structure at all.

You'd only bother with it if you were told to set an error if that ITM doesn't have any MO text linked to it.
It has nothing to do with the existence of a record on F4101

The F00165 is a table that acts as a bridge between database records and the 'BLOB' data that holds the actual text. (this is help elsewhere on the system and is not actually on the F00165

BTW, you would only get a record in the F00165 for your particular GTxxx and ITM key if you have previously saved MO text somewhere that was setup to do so.
You do this by using applications (paper clip icon and row exits - if the form is setup) and system functions.

Anyway, glad it is all working
smile.gif
 
Back
Top