USP_DATAFORMTEMPLATE_EDIT_NAMINGOPPORTUNITYFACILITY
The save procedure used by the edit dataform template "Naming Opportunity Facility Edit Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@NAME | nvarchar(100) | IN | Name |
@COUNTRYID | uniqueidentifier | IN | Country |
@STATEID | uniqueidentifier | IN | State |
@ADDRESSBLOCK | nvarchar(150) | IN | Address |
@CITY | nvarchar(50) | IN | City |
@POSTCODE | nvarchar(12) | IN | ZIP |
@AREACODEID | uniqueidentifier | IN | Area |
@UNITCODEID | uniqueidentifier | IN | Unit |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_NAMINGOPPORTUNITYFACILITY
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@NAME nvarchar(100),
@COUNTRYID uniqueidentifier,
@STATEID uniqueidentifier,
@ADDRESSBLOCK nvarchar(150),
@CITY nvarchar(50),
@POSTCODE nvarchar(12),
@AREACODEID uniqueidentifier,
@UNITCODEID uniqueidentifier
)
as
set nocount on;
declare @CURRENTDATE datetime;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
set @CURRENTDATE = getdate();
begin try
update
dbo.NAMINGOPPORTUNITYFACILITY
set
NAME = @NAME,
COUNTRYID = @COUNTRYID,
STATEID = @STATEID,
ADDRESSBLOCK = @ADDRESSBLOCK,
CITY = @CITY,
POSTCODE = @POSTCODE,
AREACODEID = @AREACODEID,
UNITCODEID = @UNITCODEID,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE
where
ID = @ID;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;