%%recordIndex%%

Is there a way to pass the current value of the %%recordIndex%% to a global?

Or a way to force the controller.recordIndex to change as you flip through records?

hi Providence1,

Providence1:
Or a way to force the controller.recordIndex to change as you flip through records?

probably I’m missing something but the recordIndexalready follows your contoller as you “flip” trought records…

you can store it in a global variable with:

globals.myvar = foundset.getSelectedIndex()

globals.myvar = foundset.getSelectedIndex()

Doesn’t seem to be working.

Essentially, I’d like to pass the servoy/utility tag, %%recordIndex%% to a global and then use that global on a form that acts as my controller.

Possible?

Using the example code:

globals.myvar = foundset.getSelectedIndex()

You would then put the following in your label:

%%globals.myvar%%

Bob

Not fogetting to check the ‘Display Tags’ property for that label

Cheers
Harry

Gosh! Did all that… and even pasted in your examples… not to forget the Display Tags checkbox…

and it still doesn’t work!

Anyone?

It should work.

Keep it simple!!!

Do a new solution, use example data as server, select products as table, make a new form with productname as field. On this new form make your experiments!!

Providence1:
Gosh! Did all that… and even pasted in your examples… not to forget the Display Tags checkbox…

and it still doesn’t work!

Anyone?

You’re using a LABEL, right? You ran the script after exiting Designer, right?

Upload a screenshot of designer view as well as data view.

Bob Cusick

You’re using a LABEL, right? You ran the script after exiting Designer, right?

Yes. and Yes.

[/quote]

So…it IS working, then!

You need to attach the method to the RECORDSELECTION event, NOT the “onShow” event of the form!

Bob

Thanks Bob!

So, how do I properly declare a foundset (see the method screenshot above) [I’ve searched five pages of forum comments]?

The following seems to be working but it’s not very elegant (the merged text on the controller containing the globals seems to be flashing/shaking as it grabs new data)

globals.gRecordIndex = forms.contact_main.controller.getSelectedIndex();
globals.gMaxRecordIndex = forms.contact_main.controller.getMaxRecordIndex();

Hey, it works - that’s the main thing.

There is no other way to get the data you want.

This is NOT FileMaker!

Bob