Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture special field values in XI?

Status
Not open for further replies.

mynameant

Programmer
Oct 19, 2005
64
US
Does anyone know how can I capture special fields and pass them onto a formula or to a database?
Eg: I want to capture users who log into BEXI
[special field-> CEUsername] and using their username, I want to retreive some values from database?

Any ideas?
Thanks
 
Well, i think you could use a variable to do this. I'm not sure how exactly. I would think that you would have to create a variable to hold the CEuser name. The Challenge that you have is that the Special Fields are procesed while Printing records, and you'll need to pass that data to the DB while reading records. I have never tried anything like that before, so i'm just guessing this is one way you could do it. I'm sure there are other options.
 
Sorry, couldn't check your reply immediately. Just got a chance to check it.
I thought I could create a variable to hold the CEuser name. But when I am in formula editor to capture this, there is no way I can get CEUsername in formual editor to say something like:

myvariable:=CEUsername;

any more ideas?
 
Hi,
It is ( sorta) a variable already - just use it where you need it ( like in a selection criteria :

{databasetable}.{idfield} = CeCurrentUser )

We used it this way all the time to limit data based on the user running the report - we did not want to use Business Views or their security methods.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks Turkbear, I'll give it a try. Hopefully it works.
Thanks for your help.
 
Hi,
To clarify,
In addition to having a database field to use in a selection formula that contained an ID = to the users CeCurrentUser we also used that special field in a Case or If statement in the selection formula in addition to any other criteria, like

If CeCurrentUser = 'JSMITH' then
{databasetable.locationnumber in [2,3,4] else
If CeCurrentUser = 'JDOE' then
{databasetable.locationnumber} in [5,6,7] else
...





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I am trying to assign current user to my Parameter like this:
{?MyParameter}=ceCurrentUser

it fails on "a number , currency , boolean, string is expected here" error.

Same if I do with a {databasetable.columnName}=ceCurrentUser.

I also tried the way you are doing:
If ceCurrentUser='USER1' then
{databasetable.columnName}='USER1';

it fails with same error.

Am I missing something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top