USP_DATAFORMTEMPLATE_EDITLOAD_PROSPECTRESEARCHREQUESTASSIGN

The load procedure used by the edit dataform template "Prospect Research Request Assign Edit 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.
@ASSIGNEDTOID uniqueidentifier INOUT Researcher
@ASSIGNCHILDREN bit INOUT Assign individual requests to the same researcher
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_PROSPECTRESEARCHREQUESTASSIGN(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @TSLONG bigint = 0 output,
    @ASSIGNEDTOID uniqueidentifier = null output,
    @ASSIGNCHILDREN bit = null output,
    @CURRENTAPPUSERID uniqueidentifier
)
as

    set nocount on;

    -- be sure to set these, in case the select returns no rows

    set @DATALOADED = 0
    set @TSLONG = 0

    declare @CONSTITUENTID uniqueidentifier
    select @CONSTITUENTID = CONSTITUENTID from dbo.APPUSER where APPUSER.ID = @CURRENTAPPUSERID

    select
        @DATALOADED = 1,
        @TSLONG = TSLONG,
        @ASSIGNEDTOID = coalesce(ASSIGNEDTOID, @CONSTITUENTID),
        @ASSIGNCHILDREN = 1
    from dbo.PROSPECTRESEARCHREQUEST
    where ID = @ID

    return 0;