When developing screen layouts in GoldMine it can be quite tedious to set the tab order from the new field positions.
The script below is for experimentation as it has worked on a number of my sites, but I would recommend taking a backup (or two) before it gets used. It only works on SQL hosted systems and has only been tested on GoldMine 7.x and below, as the screens in 8.x and higher have more flexibility.
The script works be going through the fields from left to right on each row, and increments the tab order by 1 for each field. It does this for each field view.
declare @tb int declare @vwid varchar(25) declare @vw varchar(25) declare @recid varchar(15)
set @vwid=''
declare c cursor for select viewid,recid from fields5 where rectype='F' and viewid='000001' and isnull(fldname,'')!='' order by viewid, case when cast(fcol as int)<50 then 0 else 1 end , (frow * 1000)+fcol
open c fetch c into @vw,@recid while @@fetch_status=0 begin if @vwid<>@vw begin set @tb=10 set @vwid=@vw end update fields5 set fldpos=' '+cast(@tb as varchar) where recid=@recid set @tb=@tb+1 fetch c into @vw,@recid end close c deallocate c
declare c cursor for select viewid,recid from fields5 where rectype='F' and viewid<>'000001' and isnull(fldname,'')!='' order by viewid,(frow * 1000)+fcol set @vwid='' open c fetch c into @vw,@recid while @@fetch_status=0 begin if @vwid<>@vw begin set @tb=10 set @vwid=@vw end update fields5 set fldpos=' '+cast(@tb as varchar) where recid=@recid set @tb=@tb+1 fetch c into @vw,@recid end close c deallocate c
|