Tel. +44(0)208 4716864
info@softstuff-consulting.com
Follow us on Twitter  http://www.twitter.com/softstuffc
Softstuff Home Knowledgebase Home Contact Us Blog
GoldMine CRM SQL Server QuoteWerks Microsoft Excel Microsoft Word C# Windows XP Microsoft Dynamics CRM HEAT Sage CRM
Script to set the tab order of field layouts

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


12 August 2009  IB      GoldMine CRM


Back To List

Did this article answer your question

 Yes

 No

 



 

Search our knowledgebase

Look In   For  
Enter a word or phrase to search for. eg. shrink

Enter your Email Address to receive the latest knowledgebase items delivered direct to your inbox.

Subscribe to the knowledgebase in your favourite RSS reader:   Plain RSS 2.0 Feed   Add to Google  Add to My Yahoo!

Note:
Softstuff accepts no responsibility for the use of information contained within this item. No warranties are implied or provided and it is advised that you have a working knowledge of the technologies contained, and we will not be held liable for system downtime, or data loss caused, unless we have specifically advised in writing to you that this is the case during the course of a support issue raised and accepted by us.
 

Copyright Softstuff Consulting 2007-2009