Question about Media Object form control

Bob B

Guest
I need to be able to display a form that has only one control - a media object window. I need to be able to enforce the user being required to enter text into the media object before the OK button is accepted - cancel is not an option.

When I include the media object name in an IF statement, looking for nulls, blanks, etc., I always get errors like "/* CER ERROR #3036 : Form Control with NO szDict assigned */" and "/* CER ERROR #3020 : Invalid criteria subject */".

Looks like referencing the media object window this way is not allowed. Can anyone suggest a way for me to detect when the user has or has not entered a value in the Media object window?
 
Depends what release you're on.

I did do something similar a while back by checking the text length on the MO JDE table.
Saved it on entry and compared it on the way out
If it was the same, they hadn't entered anything extra, or at all

F00165 is the table.
Do a select on the OBNM and TXKY and look at the 'length' column.
I've noticed in 8.12 that column is missing, so I can't tell you the column name sorry

Ah... Just found my old ER code
smile.gif


evt_GCVendorInvoiceNumber
evt_GTNameObject
evt_TimeOfDayACTUAL
evt_MediaObjectLengthOfTextBEF
evt_MediaObjectLengthOfTextAFT
evt_DummyFlag
0001 //
0002 // check if SECOND MO text length is > than FIRST (Has it been added to)
0003 // Save time and date of MO attachment
0004 //
0005 VA evt_GTNameObject = "GT550411D"
0006 // Strip the blanks out of the field by using the AN8 compressed description BSFN
0007 VA evt_GCVendorInvoiceNumber = GC InvoiceNumber
0008 F0101 Edit Compressed Description
GC Invoice Number [HIDDEN] -> szNameAlpha
VA evt_GCVendorInvoiceNumber <- szDescripCompressed
"<Zero>" -> cABSearchMode
UNDEFINED X cLanguageType
0009 // Construct TXKY with | in between the key fields
0010 VA frm_MediaObjectTextKey_TXKY = [GC SupplierNumber]
0011 VA frm_MediaObjectTextKey_TXKY = concat( [VA frm_MediaObjectTextKey_TXKY],'|' )
0012 VA frm_MediaObjectTextKey_TXKY = concat([VA frm_MediaObjectTextKey_TXKY],[VA evt_GCVendorInvoiceNumber])
0013 VA frm_MediaObjectTextKey_TXKY = concat( [VA frm_MediaObjectTextKey_TXKY],'|' )
0014 VA frm_MediaObjectTextKey_TXKY = concat([VA frm_MediaObjectTextKey_TXKY],[GC LineNumber])
0015 //
0016 F00165.Select
VA evt_GTNameObject = TK Object Name
VA frm_MediaObjectTextKey_TXKY = TK Generic Text Key
0017 F00165.Fetch Next
VA evt_MediaObjectLengthOfTextBEF <- TK Media Object - Length of Text
0018 If SV File_IO_Status is equal to CO SUCCESS
0019 VA frm_MOALREADYEXISTS_EV01 = "1"
0020 Else
0021 VA frm_MOALREADYEXISTS_EV01 = "0"
0022 End If
0023 //
0024 //
0025 VA frm_MediaObjectExists1_EV01 = "0"

Stay in loop until Mop text is increased in length by the user

0026 While VA frm_MediaObjectExists1_EV01 is equal to <Zero>
0027 //
0028 // Call Pop up screen to inform user what they need to do
0029 Call( App:p550411D , Form: W550411DI )
"GTA0001" X Version
0030 //
0031 Access Media Object(<Default Media Object>, GT550411D, VA frm_MediaObjectTextKey_TXKY, <Edit>, VA evt_DummyFlag, <First Text Item>)
0032 //
0033 F00165.Select
VA evt_GTNameObject = TK Object Name
VA frm_MediaObjectTextKey_TXKY = TK Generic Text Key
0034 F00165.Fetch Next
VA evt_MediaObjectLengthOfTextAFT <- TK Media Object - Length of Text
0035 If SV File_IO_Status is equal to CO SUCCESS
0036 //
0037 If VA evt_MediaObjectLengthOfTextAFT is greater than VA evt_MediaObjectLengthOfTextBEF
0038 VA frm_MediaObjectExists1_EV01 = "1"
0039 End If
0044 End If
0045 //
0046 End While
 
Thanks for the detailed info, but it looks like the column for length of text is not even in F00165 under release 9.0, which I neglected to mention was our version of E1.

I found another way to do this, but like your solution, the media object has to have been already written to F00165 in order to work with the MO text.

I'd still like to find a way to examine the contents of the MO text input FC for the existence of an entry BEFORE I/O to F00165.

Does anyone have any ideas?
 
Ah ok

You can still use my idea just in a different form.
Get the text using the system fucntion, move into to a really long variable and get the length that way then?

Check on the way in and way out...? Same idea, just different way of getting the text length
 
What I'm after now is to somehow test the media FC to see if text has been entered BEFORE it's written to F00165.

One thing I noticed is that in Media Object Properties under the Control Options tab, there's a checkbox for "Required Field" but it's not select-able. Why? Is there a way to enable this feature in E1 9.0?

C'mon, someone out there must know of a way to check for the existence of text entered into a media object form control without having to do all sorts of F00165 operations! Let's hear from you!
 
Bob,

I've never tried this, but using John's idea, get media object text and save it to a large variable. After the update, save the media object text to a different large variable and compare the two variables:

If BeforeUpdate is not equal to AfterUpdate
MediaObjectChanged = "Yes"
Else
MediaObjectChanged = "No"
End If
 
When you say "...get media onject text...", do you mean fetch it from F00165, or somehow extract it out of the form control? If the latter, how?

Again, I'm trying to set up an edit so that text MUST be entered into a media object form control BEFORE it's written to F00165, rather than check and compare after a records exists in F00165.

Can you elaborate?
 
Each Media Object Structure has a field called Status. It can be captured in a variable. Status = 0 means text not entered, whereas, Status = 1 means entered. Based on this you can build the logic.
 
Bob,

Under system functions under Media Object Structures, select the structure you need and do the mapping. In action choose Get Text.
 
Back
Top