G’day @BoxSoft / Mike … John Morter here (“coming out” from retirement !)
I’ve just been watching ClarionLive #293 - for your presentation of Views … Excellent stuff, as usual !
Some feedback on your SuperStuff View-builder template;
On the Custom Order tab you have an option that reads; “Add order fields after Primary Key from Files Window” - with default = True
…
Whereas, I’m pretty sure you actually mean; “Add order fields after declared key for View’s primary-table” … 'cos, obviously, any key AFTER a PK will not have any effect !
– It’s just the wording, it works correctly; When this is set to False, SELF.AddSortOrder() is used to clear the OrderBy (before SELF.AppendOrder(~) is applied).
You may be amused to know that I’m still using mhABView.tpw (and a few other bits) from your original free template set … I’ve enhanced them a little over time, and they’ve served me very well !
Thanks for the feedback. There are two meanings of “Primary”:
The Primary key for the file in your dictionary, which is how you’re interpreting it.
The key chosen for a template’s Primary file (the initial file attached to a template instance with the PRIMARY attribute). This is what the template is referring to. Of course, the key specified there may not be unique, so adding the fields after would have an impact.
That latter usage may be internal to the template language itself, though, and not obvious from the AppGen UI. In that case, it may be worthwhile to reword the template prompt.
The Help for VIEW does call it the VIEW ( Primary File ) and specifies JOIN( ) links to the Secondary File or Secondary Key. The Templates follow that Primary - Secondary naming convention, but it is not visible.
Maybe call it “Primary View File - Selected Key”. In the shipping templates that use VIEW there does not have to be a Key selected in which case IIRC SET(Key) changes to SET(View) and the ORDER() can be any Ad Hoc sort.
Another enhancement I made to Mike’s mhABView.template was to make provision to override the default BUFFER parameters - as assigned by ViewManager.Init
as these settings might be well suited to a Browse - but not necessarily for a View / Next paradigm.
There is a switch, “Only one record will be accessed”, which does tweak the BUFFER statement. I like the idea of controlling those more specifically, so I’ll add that too.