USP_DATAFORMTEMPLATE_ADD_BATCHREVENUEORGANIZATION
The save procedure used by the add dataform template "Revenue Batch Organization Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@ORGANIZATIONNAME | nvarchar(100) | IN | Name |
@WEBADDRESS | UDT_WEBADDRESS | IN | Website |
@INDUSTRYCODEID | uniqueidentifier | IN | Industry |
@NUMEMPLOYEES | int | IN | No. of employees |
@NUMSUBSIDIARIES | int | IN | No. of subsidiary orgs |
@PARENTCORPID | uniqueidentifier | IN | Parent org |
@ORGANIZATION_ADDRESSTYPECODEID | uniqueidentifier | IN | Address type |
@ORGANIZATION_DONOTMAIL | bit | IN | Do not send mail to this address |
@ORGANIZATION_COUNTRYID | uniqueidentifier | IN | Country |
@ORGANIZATION_STATEID | uniqueidentifier | IN | State |
@ORGANIZATION_ADDRESSBLOCK | nvarchar(150) | IN | Address |
@ORGANIZATION_CITY | nvarchar(50) | IN | City |
@ORGANIZATION_POSTCODE | nvarchar(12) | IN | ZIP |
@ORGANIZATION_OMITFROMVALIDATION | bit | IN | Omit from validation |
@ORGANIZATION_CART | nvarchar(10) | IN | |
@ORGANIZATION_DPC | nvarchar(8) | IN | |
@ORGANIZATION_LOT | nvarchar(5) | IN | |
@ORGANIZATION_COUNTYCODEID | uniqueidentifier | IN | |
@ORGANIZATION_CONGRESSIONALDISTRICTCODEID | uniqueidentifier | IN | |
@ORGANIZATION_LASTVALIDATIONATTEMPTDATE | datetime | IN | |
@ORGANIZATION_VALIDATIONMESSAGE | nvarchar(100) | IN | |
@ORGANIZATION_CERTIFICATIONDATA | int | IN | |
@ORGANIZATION_PHONETYPECODEID | uniqueidentifier | IN | Phone type |
@ORGANIZATION_NUMBER | nvarchar(100) | IN | Phone number |
@ORGANIZATION_EMAILADDRESSTYPECODEID | uniqueidentifier | IN | Email type |
@ORGANIZATION_EMAILADDRESS | UDT_EMAILADDRESS | IN | Email address |
@ORGANIZATION_DONOTMAILREASONCODEID | uniqueidentifier | IN | Reason |
@INFOSOURCECODEID | uniqueidentifier | IN |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_BATCHREVENUEORGANIZATION
(
@ID uniqueidentifier = null output,
@CURRENTAPPUSERID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@ORGANIZATIONNAME nvarchar(100),
@WEBADDRESS dbo.UDT_WEBADDRESS = '',
@INDUSTRYCODEID uniqueidentifier = null,
@NUMEMPLOYEES int = 0,
@NUMSUBSIDIARIES int = 0,
@PARENTCORPID uniqueidentifier = null,
@ORGANIZATION_ADDRESSTYPECODEID uniqueidentifier = null,
@ORGANIZATION_DONOTMAIL bit = 0,
@ORGANIZATION_COUNTRYID uniqueidentifier = null,
@ORGANIZATION_STATEID uniqueidentifier = null,
@ORGANIZATION_ADDRESSBLOCK nvarchar(150) = '',
@ORGANIZATION_CITY nvarchar(50) = '',
@ORGANIZATION_POSTCODE nvarchar(12) = '',
-- Address Validation
@ORGANIZATION_OMITFROMVALIDATION bit = 0,
@ORGANIZATION_CART nvarchar(10) = '',
@ORGANIZATION_DPC nvarchar(8) = '',
@ORGANIZATION_LOT nvarchar(5) = '',
@ORGANIZATION_COUNTYCODEID uniqueidentifier = null,
@ORGANIZATION_CONGRESSIONALDISTRICTCODEID uniqueidentifier = null,
@ORGANIZATION_LASTVALIDATIONATTEMPTDATE datetime = null,
@ORGANIZATION_VALIDATIONMESSAGE nvarchar(100) = '',
@ORGANIZATION_CERTIFICATIONDATA integer = 0,
@ORGANIZATION_PHONETYPECODEID uniqueidentifier = null,
@ORGANIZATION_NUMBER nvarchar(100) = '',
@ORGANIZATION_EMAILADDRESSTYPECODEID uniqueidentifier = null,
@ORGANIZATION_EMAILADDRESS dbo.UDT_EMAILADDRESS = '',
@ORGANIZATION_DONOTMAILREASONCODEID uniqueidentifier = null,
@INFOSOURCECODEID uniqueidentifier = null
) as
set nocount on;
declare @CURRENTDATE datetime;
declare @KEYNAME nvarchar(100);
declare @KEYNAMEPREFIX nvarchar(50);
if @ID is null
set @ID = newid();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
if @ORGANIZATION_DONOTMAIL = 0
set @ORGANIZATION_DONOTMAILREASONCODEID = null
set @CURRENTDATE = getdate();
if @NUMEMPLOYEES is null
set @NUMEMPLOYEES = 0;
if @NUMSUBSIDIARIES is null
set @NUMSUBSIDIARIES = 0;
begin try
exec USP_BATCHREVENUECONSTITUENT_ADD @ID output,@CURRENTAPPUSERID,@CHANGEAGENTID,1,@ORGANIZATIONNAME,'','','','',null,null,0,'',
@ORGANIZATION_ADDRESSTYPECODEID,@ORGANIZATION_DONOTMAIL,@ORGANIZATION_COUNTRYID,@ORGANIZATION_STATEID,@ORGANIZATION_ADDRESSBLOCK,@ORGANIZATION_CITY,@ORGANIZATION_POSTCODE,
@ORGANIZATION_OMITFROMVALIDATION,@ORGANIZATION_CART,@ORGANIZATION_DPC,@ORGANIZATION_LOT,@ORGANIZATION_COUNTYCODEID,@ORGANIZATION_CONGRESSIONALDISTRICTCODEID,@ORGANIZATION_LASTVALIDATIONATTEMPTDATE,@ORGANIZATION_VALIDATIONMESSAGE,@ORGANIZATION_CERTIFICATIONDATA,
@ORGANIZATION_PHONETYPECODEID,@ORGANIZATION_NUMBER,@ORGANIZATION_EMAILADDRESSTYPECODEID,@ORGANIZATION_EMAILADDRESS,
null,@WEBADDRESS,@INDUSTRYCODEID,@NUMEMPLOYEES,@NUMSUBSIDIARIES,@PARENTCORPID,null,'','','','','',null,null,0,'',
null,null,0,null,0,0,0,0,null,'',null,null,null,'','','',0,
0,'','','',null,null,null,'',0,
null,'',null,null,null,0,0,null,'',0,0,0,@ORGANIZATION_DONOTMAILREASONCODEID,null,null,null,null,null,0,0,0,0,null,null,null, @INFOSOURCECODEID
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;