mhABView.TPW ... Ping: Mike Hanson

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
    image

  • 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 !

Regards, John - Melb. Australia

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.

Yes, that would work well.

In my (slightly tweaked) version of Mike’s mhABView.template I’ve referred to it as the “declared key for the View’s primary-table”.

John

I’ve changed the description to “Add order fields after View’s selected key fields”.

Also, it’s enabled only if a key is actually selected.

1 Like