PDA

View Full Version : Tip: Include PK, Hide At Runtime, for Related Grids in web/mobile



HankFay
2018-08-15, 22:17
I had to rediscover "Hide At Runtime" in column attributes in a grid section, so thought I'd give a shout-out to Lianja for having it there, and write a reminder to myself and others of its importance.

Use Case: two grids, parent and child, related. Selecting a parent filters the child grid.

If you use a surrogate (non-meaningful) Primary Key (PK) as you might wish you had* down the road if you don't, then you don't want the key to be visible.

In desktop, you can take it out of the grid and everything just works

In web/mobile, only the fields needed are sent over (apparently): taking the PK field out of the parent grid breaks the related fields.

The solution: leave it there, but check the "Hide at Runtime" checkbox for that column. Works great.

enjoy,

Hank

* Imagine you have 100,000 orders having a Foreign Key pointing to Vendor that's meaningful, and the Vendor changes its name. You will have to REPLACE on 100,000 records. The logistics on that operation are a pain that could have been avoided. It gets worse on attributes like color: "we just wanted to spell it correctly." And it was in every order detail that used that color. Effectively, users can't use the system when this is happening: their in the middle of creating a Purchase Order, the old PK values are in their PO, and they go to save, and -- oops, invalid data. It isn't pretty.