USP_DATAFORMTEMPLATE_EDITLOAD_APPUSER_FOR_ACCOUNTSYSTEM

The load procedure used by the edit dataform template "Application User Edit Account System 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.
@USERNAME nvarchar(255) INOUT Application user
@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.
@PDACCOUNTSYSTEMID uniqueidentifier INOUT Account system

Definition

Copy

    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_APPUSER_FOR_ACCOUNTSYSTEM
                    (
                        @ID uniqueidentifier,
                        @DATALOADED bit = 0 output,
                        @USERNAME nvarchar(255) = null output,
                        @TSLONG bigint = 0 output,
                        @PDACCOUNTSYSTEMID uniqueidentifier = null output    
                    )
                    as
                        set nocount on;

                        set @DATALOADED = 0;
                        set @TSLONG = 0;

                        select
                            @DATALOADED = 1,
                            @USERNAME = isnull(APPUSER.USERNAME,APPUSER.DISPLAYNAME) ,
                            @TSLONG = APPUSER.TSLONG
                        from
                            dbo.APPUSER
                        where
                            APPUSER.ID = @ID;

                        if @DATALOADED = 1
                                select
                                    @PDACCOUNTSYSTEMID = APPUSERACCOUNTSYSTEM.PDACCOUNTSYSTEMID
                                from
                                    dbo.APPUSERACCOUNTSYSTEM
                                where
                                    APPUSERACCOUNTSYSTEM.APPUSERID = @ID;    

                        return 0;