USP_DATAFORMTEMPLATE_EDIT_HOUSEHOLD_PRELOAD_2
The load procedure used by the edit dataform template "Household Edit Form 2"
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. |
@CUSTOMNAME | nvarchar(100) | INOUT | Custom name |
@DYNAMICNAME | nvarchar(100) | INOUT | Name |
@USECUSTOMNAME | bit | INOUT | Custom name |
@DESCRIPTION | nvarchar(300) | INOUT | Description |
@WEBADDRESS | UDT_WEBADDRESS | INOUT | Website |
@GIVESANONYMOUSLY | bit | INOUT | Household gives anonymously |
@PICTURE | varbinary | INOUT | Image |
@PICTURETHUMBNAIL | varbinary | INOUT | Image |
@PICTURECHANGED | bit | INOUT | Picture changed |
@HOUSEHOLDSCANBEDONORS | bit | INOUT | Households can be donors |
@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. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_HOUSEHOLD_PRELOAD_2
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@CUSTOMNAME nvarchar(100) = null output,
@DYNAMICNAME nvarchar(100) = null output,
@USECUSTOMNAME bit = null output,
@DESCRIPTION nvarchar(300) = null output,
@WEBADDRESS dbo.UDT_WEBADDRESS = null output,
@GIVESANONYMOUSLY bit = null output,
@PICTURE varbinary(max) = null output,
@PICTURETHUMBNAIL varbinary(max) = null output,
@PICTURECHANGED bit = null output,
@HOUSEHOLDSCANBEDONORS bit = null output,
@TSLONG bigint = 0 output
)
as
set nocount on
select
@DATALOADED = 1,
@ID = C.ID,
@CUSTOMNAME = case when (C.DISPLAYNAME is null or C.DISPLAYNAME = '') then C.KEYNAME else C.DISPLAYNAME end,
@DYNAMICNAME = left(dbo.UFN_NAMEFORMAT_FROMID(COALESCE (GD.NAMEFORMATFUNCTIONID, (select top(1) NAMEFORMATFUNCTIONID from dbo.HOUSEHOLDINFO order by DATEADDED)), GM.MEMBERID), 100),
@USECUSTOMNAME = case when (GD.NAMEFORMATFUNCTIONID is null) then 1 else 0 end,
@DESCRIPTION = GD.DESCRIPTION,
@GIVESANONYMOUSLY = C.GIVESANONYMOUSLY,
@PICTURETHUMBNAIL = C.PICTURETHUMBNAIL,
@WEBADDRESS = C.WEBADDRESS,
@TSLONG = C.TSLONG
from dbo.CONSTITUENT C
inner join dbo.GROUPDATA GD on C.ID = GD.ID
left join dbo.GROUPMEMBER GM on C.ID = GM.GROUPID and GM.ISPRIMARY <> 0
where
C.ID = @ID and
C.ISORGANIZATION = 0 and
C.ISGROUP = 1;
set @HOUSEHOLDSCANBEDONORS = dbo.UFN_INSTALLATIONINFO_GETHOUSEHOLDSCANBEDONORS()
return 0;