USP_DATAFORMTEMPLATE_EDITLOAD_RELATIONSHIPJOBINFO
The load procedure used by the edit dataform template "Relationship Job Info Edit Data Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@JOBTITLE | nvarchar(100) | INOUT | Job title |
@CAREERLEVELCODEID | uniqueidentifier | INOUT | Career level |
@JOBCATEGORYCODEID | uniqueidentifier | INOUT | Category |
@STARTDATE | date | INOUT | Start date |
@ENDDATE | date | INOUT | End date |
@JOBDIVISION | nvarchar(100) | INOUT | Division |
@JOBDEPARTMENT | nvarchar(100) | INOUT | Department |
@JOBSCHEDULECODEID | uniqueidentifier | INOUT | Schedule |
@JOBRESPONSIBILITY | nvarchar(250) | INOUT | Responsibilities |
@ISPRIVATERECORD | bit | INOUT | Is private |
@SYNCENDDATETORELATIONSHIP | bit | INOUT | |
@ISLASTJOB | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_RELATIONSHIPJOBINFO(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@JOBTITLE nvarchar(100) = null output,
@CAREERLEVELCODEID uniqueidentifier = null output,
@JOBCATEGORYCODEID uniqueidentifier = null output,
@STARTDATE date = null output,
@ENDDATE date = null output,
@JOBDIVISION nvarchar(100) = null output,
@JOBDEPARTMENT nvarchar(100) = null output,
@JOBSCHEDULECODEID uniqueidentifier = null output,
@JOBRESPONSIBILITY nvarchar(250) = null output,
@ISPRIVATERECORD bit = null output,
@SYNCENDDATETORELATIONSHIP bit = null output,
@ISLASTJOB bit = null output
)
as
set nocount on;
-- be sure to set these, in case the select returns no rows
set @DATALOADED = 0
set @TSLONG = 0
declare @RELATIONSHIPSETID uniqueidentifier;
declare @LASTRELATIONSHIPJOBINFOID uniqueidentifier;
-- populate the output parameters, which correspond to fields on the form. Note that
-- we set @DATALOADED = 1 to indicate that the load was successful. Otherwise, the system
-- will display a "no data loaded" message. Also note that we fetch the TSLONG so that concurrency
-- can be considered.
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@JOBTITLE = JOBTITLE,
@CAREERLEVELCODEID = CAREERLEVELCODEID,
@JOBCATEGORYCODEID = JOBCATEGORYCODEID,
@STARTDATE = STARTDATE,
@ENDDATE = ENDDATE,
@JOBDIVISION = JOBDIVISION,
@JOBDEPARTMENT = JOBDEPARTMENT,
@JOBSCHEDULECODEID = JOBSCHEDULECODEID,
@JOBRESPONSIBILITY = JOBRESPONSIBILITY,
@ISPRIVATERECORD = ISPRIVATERECORD,
@RELATIONSHIPSETID = RELATIONSHIPSETID,
@SYNCENDDATETORELATIONSHIP = 1
from dbo.RELATIONSHIPJOBINFO
where ID = @ID
select top 1 @LASTRELATIONSHIPJOBINFOID = ID
from dbo.RELATIONSHIPJOBINFO
where RELATIONSHIPSETID = @RELATIONSHIPSETID
order by STARTDATE desc, ENDDATE asc;
if @LASTRELATIONSHIPJOBINFOID = @ID
begin
set @ISLASTJOB = 1;
end
else
begin
set @ISLASTJOB = 0;
set @SYNCENDDATETORELATIONSHIP = 0;
end
return 0;