USP_DATAFORMTEMPLATE_EDITLOAD_MERCHANDISEPRODUCTINSTANCE
The load procedure used by the edit dataform template "Merchandise Item Instance Edit Data 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. |
@COST | money | INOUT | Cost |
@SALEPRICE | money | INOUT | Sale price |
@ONHANDQUANTITY | int | INOUT | Quantity |
@BARCODE | nvarchar(23) | INOUT | SKU |
@OPTIONCOUNT | int | INOUT | Option count |
@PRODUCTINSTANCEOPTIONS | xml | INOUT | Options |
@OPTION1ID | uniqueidentifier | INOUT | Option 1 ID |
@OPTION2ID | uniqueidentifier | INOUT | Option 2 ID |
@OPTION3ID | uniqueidentifier | INOUT | Option 3 ID |
@OPTION1VALUE | nvarchar(50) | INOUT | Option 1 value |
@OPTION2VALUE | nvarchar(50) | INOUT | Option 2 value |
@OPTION3VALUE | nvarchar(50) | INOUT | Option 3 value |
@INSTANCEOPTION1ID | uniqueidentifier | INOUT | Option 1 value |
@INSTANCEOPTION2ID | uniqueidentifier | INOUT | Option 2 value |
@INSTANCEOPTION3ID | uniqueidentifier | INOUT | Option 3 value |
@LOOKUPCODE | nvarchar(25) | INOUT | UPC |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_MERCHANDISEPRODUCTINSTANCE(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@COST money = null output,
@SALEPRICE money = null output,
@ONHANDQUANTITY integer = null output,
@BARCODE nvarchar(23) = null output,
@OPTIONCOUNT integer = null output,
@PRODUCTINSTANCEOPTIONS xml = null output,
@OPTION1ID uniqueidentifier = null output,
@OPTION2ID uniqueidentifier = null output,
@OPTION3ID uniqueidentifier = null output,
@OPTION1VALUE nvarchar(50) = null output,
@OPTION2VALUE nvarchar(50) = null output,
@OPTION3VALUE nvarchar(50) = null output,
@INSTANCEOPTION1ID uniqueidentifier = null output,
@INSTANCEOPTION2ID uniqueidentifier = null output,
@INSTANCEOPTION3ID uniqueidentifier = null output,
@LOOKUPCODE nvarchar(25) = null output
)
as
set nocount on;
-- be sure to set these, in case the select returns no rows
set @DATALOADED = 0
set @TSLONG = 0
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@COST = COST,
@SALEPRICE = SALEPRICE,
@ONHANDQUANTITY = ONHANDQUANTITY,
@BARCODE = BARCODE,
@LOOKUPCODE = LOOKUPCODE
from dbo.MERCHANDISEPRODUCTINSTANCE
where ID = @ID
declare @MERCHANDISEPRODUCTID uniqueidentifier
select
@MERCHANDISEPRODUCTID = MERCHANDISEPRODUCTID
from
dbo.MERCHANDISEPRODUCTINSTANCE
where
ID = @ID
select
@OPTIONCOUNT = count(*)
from
dbo.MERCHANDISEPRODUCTOPTION
where
MERCHANDISEPRODUCTID = @MERCHANDISEPRODUCTID
if @OPTIONCOUNT > 0
begin
set @PRODUCTINSTANCEOPTIONS = dbo.UFN_MERCHANDISE_GETPRODUCTINSTANCEOPTIONS_2_TOITEMLISTXML(@ID)
end
return 0;