USP_DATAFORMTEMPLATE_EDITLOAD_MKTLIST
The load procedure used by the edit dataform template "List 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. |
@NAME | nvarchar(43) | INOUT | Name |
@DESCRIPTION | nvarchar(255) | INOUT | Description |
@CODE | nvarchar(10) | INOUT | Code |
@LISTCATEGORYCODEID | uniqueidentifier | INOUT | Category |
@VENDORID | uniqueidentifier | INOUT | Vendor |
@RECORDSOURCEID | uniqueidentifier | INOUT | Record source |
@RECORDSOURCELOCKED | bit | INOUT | Record source locked |
@RECORDSOURCEHIDDEN | bit | INOUT | Record source hidden |
@BASERENTALCOST | money | INOUT | Base rental cost |
@BASERENTALCOSTBASISCODE | tinyint | INOUT | Base rental cost basis code |
@BASEEXCHANGECOST | money | INOUT | Base exchange cost |
@BASEEXCHANGECOSTBASISCODE | tinyint | INOUT | Base exchange cost basis code |
@CODEVALUEID | uniqueidentifier | INOUT | Code value ID |
@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. |
@BASECURRENCYID | uniqueidentifier | INOUT | Base currency ID |
@SITEID | uniqueidentifier | INOUT | Site |
@SITEREQUIRED | bit | INOUT | Site required? |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@LISTPARTDEFINITIONID | uniqueidentifier | INOUT |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTLIST]
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(43) = null output,
@DESCRIPTION nvarchar(255) = null output,
@CODE nvarchar(10) = null output,
@LISTCATEGORYCODEID uniqueidentifier = null output,
@VENDORID uniqueidentifier = null output,
@RECORDSOURCEID uniqueidentifier = null output,
@RECORDSOURCELOCKED bit = null output,
@RECORDSOURCEHIDDEN bit = null output,
@BASERENTALCOST money = null output,
@BASERENTALCOSTBASISCODE tinyint = null output,
@BASEEXCHANGECOST money = null output,
@BASEEXCHANGECOSTBASISCODE tinyint = null output,
@CODEVALUEID uniqueidentifier = null output,
@TSLONG bigint = 0 output,
@BASECURRENCYID uniqueidentifier = null output,
@SITEID uniqueidentifier = null output,
@SITEREQUIRED bit = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@LISTPARTDEFINITIONID uniqueidentifier = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
select
@DATALOADED = 1,
@NAME = [NAME],
@DESCRIPTION = [DESCRIPTION],
@CODE = [CODE],
@LISTCATEGORYCODEID = [LISTCATEGORYCODEID],
@VENDORID = [VENDORID],
@RECORDSOURCEID = [RECORDSOURCEID],
/* This should be locked based on the list segment usage in activated mailings */
@RECORDSOURCELOCKED = (case when exists(
select top 1 1
from dbo.[MKTSEGMENTATIONSEGMENTLIST]
inner join dbo.[MKTSEGMENTLIST] on [MKTSEGMENTLIST].[ID] = [MKTSEGMENTATIONSEGMENTLIST].[SEGMENTLISTID]
where [MKTSEGMENTLIST].[LISTID] = [MKTLIST].[ID])
then 1 else 0 end),
@RECORDSOURCEHIDDEN = (case when (select count(1) from dbo.[MKTRECORDSOURCE] where dbo.[UFN_MKTRECORDSOURCE_VALIDFORPRODUCT]([ID]) = 1) = 1 then 1 else 0 end),
@BASERENTALCOST = [BASERENTALCOST],
@BASERENTALCOSTBASISCODE = [BASERENTALCOSTBASISCODE],
@BASEEXCHANGECOST = [BASEEXCHANGECOST],
@BASEEXCHANGECOSTBASISCODE = [BASEEXCHANGECOSTBASISCODE],
@CODEVALUEID = [PARTDEFINITIONVALUESID],
@TSLONG = [TSLONG],
@BASECURRENCYID = [BASECURRENCYID],
@SITEID = [SITEID]
from dbo.[MKTLIST]
where [ID] = @ID;
set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '4DCC7F29-6003-42D6-93FE-24A3D86E2EEA', 1);
select @LISTPARTDEFINITIONID = [ID] from dbo.[MKTSOURCECODEPARTDEFINITION] where [ITEMTYPECODE] = 6;
return 0;