Constituent Update Batch Extension

I am having a frustrating issue with extending the Constituent Update Batch. I have done this in the past without issue but do not see what I am doing wrong here. When I load the spec it gives me the error “The form definition contains fields that are not defined as parameters for procedure 'USR_DAV_USP_DATAFORMTEMPLATE_COMMITEDIT_DISASTER_RELIEF_LOAD'”

That is the load implementation of the commit edit row. It has all of the parameters that are listed as fields in the form definition. Hopefully I have a simple mistake somewhere and someone out there can spot it. ?‍♂ Below is the commit edit row, and the form definitions

<FormMetaData xmlns="bb_appfx_commontypes">
<FormFields>
<FormField FieldID="USR_NSOOFFICEID" Caption="NSO Office" DataType="Guid">
<SimpleDataList SimpleDataListID="05fac3ce-97c5-4783-a26a-82782254ad66" />
</FormField>
<FormField FieldID="USR_DATEGRANTED" Caption="Date Granted" DataType="Date" />
<FormField FieldID="USR_AMOUNT" Caption="Amount" DataType="Money" />
<FormField FieldID="USR_USERCODEID" Caption="User Code" DataType="Guid">
<CodeTable CodeTableName="USR_DAV_DISASTER_RELIEF_USER_CODECODE"/>
</FormField>
<FormField FieldID="USR_REASONCODEID" Caption="Reason Code" DataType="Guid">
<CodeTable CodeTableName="USR_DAV_DISASTER_RELIEF_REASON_CODECODE"/>
</FormField>
</FormFields>
</FormMetaData>

<EditRow DataFormInstanceID="B22D1CAF-A2B5-4A85-BCDC-D61D31CAD367" DataFormTemplateID="24527C47-B008-495E-80C8-FAAF8337F84F" EditLoadField="PRIMARYRECORDID">
<LoadImplementation SPName="USR_DAV_USP_DATAFORMTEMPLATE_COMMITEDIT_DISASTER_RELIEF_LOAD">
<c:CreateProcedureSQL>
<![CDATA[
create procedure dbo.USR_DAV_USP_DATAFORMTEMPLATE_COMMITEDIT_DISASTER_RELIEF_LOAD
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@USR_NSOOFFICEID uniqueidentifier = null output,
@USR_DATEGRANTED datetime = null output,
@USR_AMOUNT money = null output,
@USR_USERCODEID uniqueidentifier = null output,
@USR_REASONCODEID uniqueidentifier = null output
)
as
SELECT @DATALOADED = 1, @TSLONG = C.TSLONG
FROM CONSTITUENT C
WHERE C.ID = @ID

return 0;
]]>
</c:CreateProcedureSQL>
</LoadImplementation>
<SaveImplementation SPName="USR_DAV_USP_DATAFORMTEMPLATE_COMMITEDITSAVE_DISASTER_RELIEF">
<c:CreateProcedureSQL>
<![CDATA[
create procedure dbo.USR_DAV_USP_DATAFORMTEMPLATE_COMMITEDITSAVE_DISASTER_RELIEF
(
@ID uniqueidentifier output,
@CHANGEAGENTID uniqueidentifier = null,
@USR_NSOOFFICEID uniqueidentifier,
@USR_DATEGRANTED datetime,
@USR_AMOUNT money,
@USR_USERCODEID uniqueidentifier,
@USR_REASONCODEID uniqueidentifier,
@VALIDATEONLY bit = 0
)
as
set nocount on;

if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()

IF @VALIDATEONLY = 0
BEGIN
begin try
INSERT INTO USR_DAV_DISASTER_RELIEF (ID, CONSTITUENTID, NSOOFFICEID, DATEGRANTED, AMOUNT, USERCODEID, REASONCODEID, DATEADDED, DATECHANGED, ADDEDBYID, CHANGEDBYID)
VALUES (NEWID(), @ID, @USR_NSOOFFICEID, @USR_DATEGRANTED, @USR_AMOUNT, @USR_USERCODEID, @USR_REASONCODEID, @CURRENTDATE, @CURRENTDATE, @CHANGEAGENTID, @CHANGEAGENTID)
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
END

return 0;
]]>
</c:CreateProcedureSQL>
</SaveImplementation>
</EditRow>

Comments

  • @Nick McGinnis I have crawled the form and do not see what is causing the error. I have hit frustrating problems like this from time to time. I recommend simplifying and commenting out all of your stored procedures and form, then turning on the parameters in both the form and stored procs one at a time until the error re-appears. Sorry I did not spot the error. Good luck, phasers on stun.

  • After a lot of head scratching and frustration I figured out the issue. I had VALIDATEONLY being passed into both the commit add/edit save implementations. Oddly enough it was complaining about it on the edit load. I found this blurb in the documentation:

    Hey, where is the @VALIDATEONLY Flag within the commit stored procedure for a batch extension?

    "Validate Only" is not recognized within batch extensions. The value for the @VALIDATEONLY flag does not get passed to the commit for batch extensions.

    Answering this question so if anyone else stumbles across this same issue hopefully removing VALIDATEONLY from your extension will solve it!

Categories