USP_DATAFORMTEMPLATE_EDITLOAD_MKTMARKETINGPLANITEMEXPENSE

The load procedure used by the edit dataform template "Marketing Plan Item Expense 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.
@DESCRIPTION nvarchar(max) INOUT Description
@EXPENSECATEGORYCODEID uniqueidentifier INOUT Category
@EXPENSETYPECODE tinyint INOUT Type
@COUNT int INOUT Count
@AMOUNT money INOUT Unit cost
@BUDGETAMOUNT money INOUT Budget amount
@QUANTITY int INOUT Quantity
@RESPONSES int INOUT Responses
@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

Definition

Copy


CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTMARKETINGPLANITEMEXPENSE]
(
  @ID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @DESCRIPTION nvarchar(max) = null output,
  @EXPENSECATEGORYCODEID uniqueidentifier = null output,
  @EXPENSETYPECODE tinyint = null output,
  @COUNT integer = null output,
  @AMOUNT money = null output,
  @BUDGETAMOUNT money = null output,
  @QUANTITY integer = null output,
  @RESPONSES integer = null output,
  @TSLONG bigint = 0 output,
  @BASECURRENCYID uniqueidentifier = null output
)
as
  set nocount on;

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

  select
    @DATALOADED = 1,
    @DESCRIPTION = [MPIE].[DESCRIPTION],
    @EXPENSECATEGORYCODEID = [MPIE].[EXPENSECATEGORYCODEID],
    @EXPENSETYPECODE = [MPIE].[EXPENSETYPECODE],
    @COUNT = [MPIE].[COUNT],
    @BASECURRENCYID = [MPIE].[BASECURRENCYID],
    @AMOUNT = [MPIE].[AMOUNT],
    @BUDGETAMOUNT = [MPIE].[BUDGETAMOUNT],
    @QUANTITY = [MPI].[QUANTITY],
    @RESPONSES = [MPI].[TOTALTRANSACTIONSGOAL],
    @TSLONG = [MPIE].[TSLONG]
  from dbo.[MKTMARKETINGPLANITEMEXPENSE] as [MPIE]
  inner join dbo.[MKTMARKETINGPLANITEM] as [MPI] on [MPI].[ID] = [MPIE].[MARKETINGPLANITEMID]
  where [MPIE].ID = @ID;

  return 0;