by BBlum » Thu Jul 29, 2010 10:50 am
There is very little information on how to construct and install a stored procedure to use with AutoNumbering.
I recently designed code for a client where the Stored Procedure looked something like this:
USE [Vision]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AMRProjectID]
( /*N*/@OfficeToConvert varchar(1)
,/*N*/@ChargeTypeToConvert varchar(1)
,/*N*/@WBS1 varchar(12) OUTPUT)
AS
BEGIN
set @WBS1 = ?????
RETURN 0
END
The "set @WBS1" code can use Select SQL statements to gather the information you need. In this case, we passed the Org code and Charge Type from the Project Info Center for the new project into the stored procedure. We manipulated the data and passed the new project ID back as WBS1.
When you let Vision know you are using a stored procedure for the AutoNumber, it will allow you to enter the Stored Procedure ID and will show you the two passed field names that you will map to Vision fields.
Good luck,
Bill Blum