USP_DATAFORM_PRELOAD_SETALL_MAILPREFERENCE
The load procedure used by the edit dataform template "Mail Preference Set All Add Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CONSTITUENTID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@ISORG | bit | INOUT | |
@HASPREFERENCES | bit | INOUT | |
@USESEASONALADDRESS | bit | INOUT | Send to seasonal address when valid |
@ISGROUP | bit | INOUT | Is group |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@SITEREQUIRED | bit | INOUT | Site Required |
@SITEID | uniqueidentifier | INOUT | Site |
Definition
Copy
CREATE procedure dbo.USP_DATAFORM_PRELOAD_SETALL_MAILPREFERENCE(
@CONSTITUENTID uniqueidentifier,
@ISORG bit = null output,
@HASPREFERENCES bit = null output,
@USESEASONALADDRESS bit = null output,
@ISGROUP bit = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@SITEREQUIRED bit = null output,
@SITEID uniqueidentifier = null output
)
as
set nocount on;
select
@ISORG=ISORGANIZATION,
@ISGROUP=ISGROUP
from dbo.CONSTITUENT
where ID=@CONSTITUENTID;
set @HASPREFERENCES = 0
select
@HASPREFERENCES = 1
from MAILPREFERENCE
where exists(
select ID
from MAILPREFERENCE
where CONSTITUENTID=@CONSTITUENTID)
if (@ISORG = 1) or (@ISGROUP = 1)
begin
set @USESEASONALADDRESS = 0
end
else
begin
set @USESEASONALADDRESS = 1
end
set @SITEREQUIRED = dbo.UFN_SITEREQUIREDFORUSER(@CURRENTAPPUSERID);
set @SITEID = dbo.UFN_APPUSER_DEFAULTSITEFORUSER(@CURRENTAPPUSERID);
return 0;