Using Browser Hints to Automatically Display Selected Forms
This feature allows Virtual Ticket and/or Digital Storage Manager to automatically open and display forms based on criteria that you define in the system.
Note: This solution is optimized for Virtual Ticket Developer.
If you are using Workgroups DaVinci and are planning to use a Toolbox snippet not marked as DaVinci-compatible, please check with Support for possible compatibility issues before using.
Virtual Ticket and Digital Storage Manager forms can be designated for automatic display by establishing browser hints in a SQL stored procedure. Browser hints can be established to take information from a database field and dynamically determine which form should appear. This can be used, for example, to display unique forms based on specific jobs, customer, or other information referenced in the selected folder. Suppose, for example, a piece of artwork must be created for every job. The type of artwork created is specified in a database field. Based on the artwork type field, the proper form will be displayed when users select the job.
The following example shows how to always display the Job form when looking at Digital Resource records. It also shows how to display a Job form based on an artwork type field:
- Open the SQL Server Management Studio application on your SQL Server machine.
- Make a complete backup of your database(s).
- Open the forms_hint.sql example file (attached below) and select the desired database from the database list.
SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER proc custom_vtbrowser_fill_form_chooser @master_type VARCHAR(255) , @master_id VARCHAR(16) , @group_value VARCHAR(255) , @object_type VARCHAR(255) , @object_id VARCHAR(16) , @context VARCHAR(255) AS BEGIN --return 1 DECLARE @hint_form VARCHAR(255) SELECT @hint_form = 'None' IF @master_type = 'Digital Resources' BEGIN SELECT @hint_form = CASE WHEN @master_type = 'Digital Resources' THEN 'Job' END IF @master_type = 'Jobs' BEGIN IF @object_type = 'Jobs' BEGIN SELECT @job_type = [Artwork] FROM [VIEW Jobs] (nolock) WHERE [Job NUMBER] = @master_id SELECT @hint_form = CASE WHEN @job_type LIKE 'Electronic%' THEN 'Job Ticket - Prepress View' WHEN @job_type LIKE 'Loose%' THEN 'Job Ticket - Press View' WHEN @job_type LIKE 'Plate%' THEN 'Job Ticket - Bindery View' WHEN @job_type LIKE 'Camera%' THEN 'Job Ticket - Shipping View' END END END IF @hint_form = 'None' BEGIN RETURN 0 END UPDATE #vtbrowser_fill_form_chooser SET preferred_ = 1 WHERE type_ = 'F' AND ( name_ = @hint_form ) RETURN 1 END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
- Press the Execute button.
- Test the changes within the Virtual Ticket or Digital Storage Manager client application. If the SQL Script is applied correctly, each time a job with a different artwork type is viewed in the Browser window, it will display the job form specifically used by the type of artwork. Alternatively, each time a digital resource is viewed, it will display the digital resource using the 'Job' form.
NOTE: The SQL Script should only be modified by an experienced SQL Database administrator.