Avoid Keyword Lookups in Read Mode
Keyword fields (known to the younger audience as: Radio buttons, checkboxes, combobox, dropdowns etc.) very often are populated by @Formulas. @DBColumn, @DBLookup and @GetProfileField are equally popluar. For best performance you should use @GetProfileField (if that is possible in your application context). Another way to speed things up: prevent the formulas from executing in Read Mode. If for example a formula to populate the options looks like this:
tmp := @DBLookup("Notes":"NoCache";"";"(LookupProjectsBySponsor)";@UserName;2); @if(@IsError(tmp);"You don't sponsor projects"; tmp)change it to
@if(!@IsDocBeingEdited;@Return(@ThisValue);""); tmp := @DBLookup("Notes":"NoCache";"";"(LookupProjectsBySponsor)";@UserName;2); @if(@IsError(tmp);"You don't sponsor projects"; tmp)You can refine that and not populate keywords you don't intend to change (based on a status), you would update the first condition then.
Posted by Stephan H Wissel on 03 December 2008 | Comments (2) | categories: Show-N-Tell Thursday