AnsweredAssumed Answered

"Show All Records" bug with portal relationships?

Question asked by sebieire on Feb 6, 2019
Latest reply on Feb 9, 2019 by gdurniak

Hi All,

I came across something strange (FM12Pro). This might be a bug so I am just flagging it here and see what workaround there is.

 

Following scenario:

 

Script A (collecting data across various tables - fairly long and complex with several subscripts) runs fine when specific tables in the DB have no "Found Records selected" and are showing ALL records before it is launched.

 

The script is triggered through a button that sits in every portal row of a portal that obviously looks into the "many relationship". That means obviously that each button (even though the same script) is linked to it's own child-record primary key. So basically has it's own parameter from the get go.

 

To elaborate. If I press BTN1 in the portal it runs for that child record. BTN2 for the next and so on and on. All works fine.

However (as mentioned above) if by accident a subset of records is selected in that Childtable the script returns errors or false results as would be expected.

 

So I thought: "Ok fair enough - I just create a small pre-script" that jumps through the various tables and makes them "ShowAllRecords" before the main script starts. That should solve the issue no hassle.

 

However upon returning to the "originalLayout" to launch the script then it will now automatically and ALWAYS use BTN1 (with it's parameters and PK) instead of the BTN that I had actually clicked on. Very very strange! It is as if it looses it's origin click (while executing the clean up script to show all records) and picks randomly the first (BTN1) in the portal. That shouldn't happen!

 

I know there are probably some clever workarounds... like setting the variable up first, then do the clean up, and then pass the variable back in kind of thing. Just a pity that this has to be done that way in order to work.

 

Questions is, is there some sort of "global reset" that will just show all records everywhere without having to jump to every layout and do "ShowAllRecords"?

 

I hope all of this makes sense

 

Cheers

Outcomes