Stored procedure insert not updating database

by  |  20-Feb-2016 14:23

One SQL stored procedure can be used to perform both the create and update operations for your document type.

To create a SQL stored procedure that performs the create and update operations, complete the following steps: Open Visual Studio.

If you are prompted to add a database reference, add a reference to your Dynamics GP data server, and then click OK. In the Add New Item window, click SQL Script in the Templates list.

Enter a name for your script file, and then click Add.

Notice how a value is assigned to the @O_i Error State output parameter after each validation error.

Hint: The e Connect error reporting system uses this parameter value to retrieve the error message from the ta Error Code table of the the DYNAMICS (system) database.

For more information about how to add error codes, see /** Verify there are no null required parameters **/ if(@I_v Lead Id is null or @I_v Lead Name is null or @I_v SLPRSNID is null or @I_v Lead Business Category is null ) begin select @O_i Error State = 61061 /* A required parameter was null */ exec @i Status = ta Update String @O_i Error State, @o Err String, @o Err String output, @O_o Error State output return (@O_i Error State) end /** Verify there are no invalid negative amounts **/ if (@I_v Potential Revenue Determine whether the SQL stored procedure should create a new record or update an existing record.

Community Discussion