Restricting options in UBE data selection

johndanter

johndanter

Legendary Poster
Hi folks,

We have created a UBEVER and the user is prompted to enter their MCU and ITM.
So in the versions data selection MCU and ITM were setup the usual way with = NULL

What some users have been doing is saying WHERE BC ITM = BC ITM (rather than the list they should be using)

Data Selection in Job is
IF CostCenter (F41021)(MCU)[String] == Literal: 236S
AND IdentifierShortItem (F41021)(ITM)[MATH_NUMERIC] == IdentifierShortItem (F41021)(ITM)[MATH_NUMERIC]

SQL
SELECT LIITM, LIMCU, LILOCN, LILOTN, LIPBIN, LIQWBO, LIHCOM, LIPCOM, LIFUN1, LIQOWO, LIQTY1, LIJOBN, LIPID, LIUPMJ, LIUSER, LITDAY, LIPJCM FROM CRPDTA.F41021 WHERE ( ( LIMCU = ' 236S' AND LIITM = LIITM ) ) ORDER BY LIITM ASC,LIMCU ASC,LIPBIN ASC


Is there a way of restricting users from doing this and forcing them to add actual literal values.

Thanks

John
 
Last edited:
Our jobs would be so much easier w/o users.

Only thing I can think of off the top of my head would be to interrogate the data selection at run-time and suppress running the report if the data selection has something invalid like what you describe. You would have to use the C API ubeSection_GetDataSelection. And then effectively look for something like:

Code:
	jdeNIDcpy( select[nSelIdx].Item1.szDict,		NID_ITM);
	jdeNIDcpy( select[nSelIdx].Item1.szTable,	NID_F41021);
	select[nSelIdx].Item1.idInstance		        = (ID)0;
	jdeNIDcpy( select[nSelIdx].Item2.szDict,		NID_ITM);            //!!!!!!!!!! this is how it would look with the WHERE clause you described instead of being _J("")
	jdeNIDcpy( select[nSelIdx].Item2.szTable,	NID_F41021);       //!!!!!!!!!! this is how it would look with the WHERE clause you described instead of being _J("")
	select[nSelIdx].Item2.idInstance			= (ID)0;
	select[nSelIdx].lpValue					= NULL;             //!!!!!!!!!!! this would probably also be NULL instead of a valid pointer
	select[nSelIdx].nValues				= 0;                  //!!!!!!!!!!! this would probably be zero instead of >= 1
	select[nSelIdx].nCmp				        = JDEDB_CMP_EQ;
	select[nSelIdx].nAndOr					= JDEDB_ANDOR_AND;
	select[nSelIdx++].nParen				= JDEDB_PAREN_NONE;
 
Another option - and sometimes more simple than the Processing Option thing...

If you use an App and submit the UBE and pass the values to Report Interconnects. Initially, this limits you to one MCU/Item at a time. If you transition the App / UBE to use "Data Selection Lists" - you can pass the List Name as an RI....

The App/UBE - might take a half hour (hopefully not more) - to construct.

And, as BOster says - Life is easier w/o users...!

(db)
 
Thanks folks

So there is no generic way using config or security?
 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
- Rick Cook - 1989

Some things never change ;-)
 
Back
Top