<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing Code to populate the rejection code field in batch</title>
	<atom:link href="http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/</link>
	<description>A technical look at the Raiser&#039;s Edge API from Blackbaud</description>
	<lastBuildDate>Mon, 30 Jan 2012 14:35:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David Zeidman</title>
		<link>http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/comment-page-1/#comment-5024</link>
		<dc:creator>David Zeidman</dc:creator>
		<pubDate>Thu, 25 Mar 2010 17:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.re-decoded.com/?p=286#comment-5024</guid>
		<description>Heather,

Did you manage to solve the check number issue? I too now need to populate that field and it does not seem like it is doing so.

UPDATE: I realised that you need to have the payment type set to cheque (or check depending where you are in the world!). It will then work.

David</description>
		<content:encoded><![CDATA[<p>Heather,</p>
<p>Did you manage to solve the check number issue? I too now need to populate that field and it does not seem like it is doing so.</p>
<p>UPDATE: I realised that you need to have the payment type set to cheque (or check depending where you are in the world!). It will then work.</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Zeidman</title>
		<link>http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/comment-page-1/#comment-5001</link>
		<dc:creator>David Zeidman</dc:creator>
		<pubDate>Fri, 22 Jan 2010 21:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.re-decoded.com/?p=286#comment-5001</guid>
		<description>Cate,

Thanks for your suggestions. I will definitely give it a go. One workaround would be to copy an existing batch and change the values. The problem is that no two batches are alike. The number of gifts in a batch vary so while I could copy a previous batch, or even set up a batch template in the GUI in order to copy that batch over, I would have to ensure that there were a large number of gifts present to cover the number that I may require in a later batch. I would have to loop through it and then change the values from the template batch to the new batch. Of course this could work but it is really long winded workaround which really should not be necessary.

Heather, I have, unfortunately, not tried to write the check number to a batch. It does sound like a similar case. Are you able to populate it through the GUI?

David</description>
		<content:encoded><![CDATA[<p>Cate,</p>
<p>Thanks for your suggestions. I will definitely give it a go. One workaround would be to copy an existing batch and change the values. The problem is that no two batches are alike. The number of gifts in a batch vary so while I could copy a previous batch, or even set up a batch template in the GUI in order to copy that batch over, I would have to ensure that there were a large number of gifts present to cover the number that I may require in a later batch. I would have to loop through it and then change the values from the template batch to the new batch. Of course this could work but it is really long winded workaround which really should not be necessary.</p>
<p>Heather, I have, unfortunately, not tried to write the check number to a batch. It does sound like a similar case. Are you able to populate it through the GUI?</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heather</title>
		<link>http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/comment-page-1/#comment-5000</link>
		<dc:creator>Heather</dc:creator>
		<pubDate>Fri, 22 Jan 2010 07:34:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.re-decoded.com/?p=286#comment-5000</guid>
		<description>I&#039;ve had similar weird problems, maybe you have a suggestion...

When I try to populate GIFT_fld_Check_Number it doesn&#039;t seem to actually populate (no errors, it just never shows up in RE despite definitely being populated in my debug checks).  When I try to populate GIFT_fld_Description, it throws what to me appears to be an entirely unrelated error about a column that I&#039;m not attempting to access.  BATCHAPI_fld_DESCRIPTION, on the other hand, works beautifully.

Have you tried using these fields at all?  Any thoughts?  I wish there were more documentation on this stuff.

Thanks much

-Heather</description>
		<content:encoded><![CDATA[<p>I&#8217;ve had similar weird problems, maybe you have a suggestion&#8230;</p>
<p>When I try to populate GIFT_fld_Check_Number it doesn&#8217;t seem to actually populate (no errors, it just never shows up in RE despite definitely being populated in my debug checks).  When I try to populate GIFT_fld_Description, it throws what to me appears to be an entirely unrelated error about a column that I&#8217;m not attempting to access.  BATCHAPI_fld_DESCRIPTION, on the other hand, works beautifully.</p>
<p>Have you tried using these fields at all?  Any thoughts?  I wish there were more documentation on this stuff.</p>
<p>Thanks much</p>
<p>-Heather</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cate Born</title>
		<link>http://www.re-decoded.com/2009/11/writing-code-to-populate-the-rejection-code-field-in-batch/comment-page-1/#comment-4779</link>
		<dc:creator>Cate Born</dc:creator>
		<pubDate>Tue, 29 Dec 2009 22:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.re-decoded.com/?p=286#comment-4779</guid>
		<description>I was able to populate the Rejection code field in a batch using this code (creates a copy of an existing batch).

    Private Sub CreateBackupBatch(ByVal sSrcBatchNbr As String)
        Dim oSrcBatch As CBatchAPI = New CBatchAPI
        Dim oBkpBatch As CBatchAPI = New CBatchAPI
        Dim oBkpTempRecords As CTempRecords

        &#039; Create a new, empty batch based on the design of an existing batch
        CreateBatchFromTemplate(sSrcBatchNbr, sSrcBatchNbr &amp; &quot; BKP&quot;)

        oSrcBatch.Init(coSC)
        Try
            oSrcBatch.LoadByNumber(sSrcBatchNbr)
        Catch ex As Exception
            Throw ex
        End Try

        oBkpBatch.Init(coSC)
        Try
            oBkpBatch.LoadByNumber(sSrcBatchNbr &amp; &quot; BKP&quot;)
        Catch ex As Exception
            Throw ex
        End Try
        oBkpTempRecords = oBkpBatch.TempRecords

        oBkpBatch.Fields(EBatchAPIFields.BATCHAPI_fld_BATCH_NUMER) &amp;= &quot; &quot; &amp; Now.ToString
        oBkpBatch.Save()

        Dim oSrcBatchFields As CBatchFields = oSrcBatch.BatchFields

        &#039; Copy all batch rows except the template row from source to target
        For Each oSrcTempRec As CTempRecord In oSrcBatch.TempRecords
            If oSrcTempRec.Fields(oSrcBatchFields.Count + 2)  &quot;0&quot; Then
                &#039; BD (below) is an import alias for Blackbaud.PIA.RE7.BatchData, 
                &#039; all other Batch API classes are referenced from Blackbaud.PIA.RE7.BBREAPI
                Dim oBkpTempRec As BD.CTempRecord = oBkpTempRecords.Add()
                oBkpTempRec.DataObject = oSrcTempRec.DataObject
                For Each oSrcBatchField As CBatchField In oSrcBatchFields
                    Dim i As Integer = oSrcBatchField.Fields(EBatchFieldFields.BatchField_fld_Sequence)
                    If oBkpTempRec.Fields(i)  oSrcTempRec.Fields(i) Then
                        oBkpTempRec.Fields(i) = oSrcTempRec.Fields(i)
                    End If
                Next
            End If
            oBkpTempRecords.Save()
        Next

        oBkpBatch.Save()

        oBkpTempRecords = Nothing

        oSrcBatch.CloseDown()
        FinalReleaseComObject(oSrcBatch)

        oBkpBatch.CloseDown()
        FinalReleaseComObject(oBkpBatch)
    End Sub</description>
		<content:encoded><![CDATA[<p>I was able to populate the Rejection code field in a batch using this code (creates a copy of an existing batch).</p>
<p>    Private Sub CreateBackupBatch(ByVal sSrcBatchNbr As String)<br />
        Dim oSrcBatch As CBatchAPI = New CBatchAPI<br />
        Dim oBkpBatch As CBatchAPI = New CBatchAPI<br />
        Dim oBkpTempRecords As CTempRecords</p>
<p>        &#8216; Create a new, empty batch based on the design of an existing batch<br />
        CreateBatchFromTemplate(sSrcBatchNbr, sSrcBatchNbr &amp; &#8221; BKP&#8221;)</p>
<p>        oSrcBatch.Init(coSC)<br />
        Try<br />
            oSrcBatch.LoadByNumber(sSrcBatchNbr)<br />
        Catch ex As Exception<br />
            Throw ex<br />
        End Try</p>
<p>        oBkpBatch.Init(coSC)<br />
        Try<br />
            oBkpBatch.LoadByNumber(sSrcBatchNbr &amp; &#8221; BKP&#8221;)<br />
        Catch ex As Exception<br />
            Throw ex<br />
        End Try<br />
        oBkpTempRecords = oBkpBatch.TempRecords</p>
<p>        oBkpBatch.Fields(EBatchAPIFields.BATCHAPI_fld_BATCH_NUMER) &amp;= &#8221; &#8221; &amp; Now.ToString<br />
        oBkpBatch.Save()</p>
<p>        Dim oSrcBatchFields As CBatchFields = oSrcBatch.BatchFields</p>
<p>        &#8216; Copy all batch rows except the template row from source to target<br />
        For Each oSrcTempRec As CTempRecord In oSrcBatch.TempRecords<br />
            If oSrcTempRec.Fields(oSrcBatchFields.Count + 2)  &#8220;0&#8243; Then<br />
                &#8216; BD (below) is an import alias for Blackbaud.PIA.RE7.BatchData,<br />
                &#8216; all other Batch API classes are referenced from Blackbaud.PIA.RE7.BBREAPI<br />
                Dim oBkpTempRec As BD.CTempRecord = oBkpTempRecords.Add()<br />
                oBkpTempRec.DataObject = oSrcTempRec.DataObject<br />
                For Each oSrcBatchField As CBatchField In oSrcBatchFields<br />
                    Dim i As Integer = oSrcBatchField.Fields(EBatchFieldFields.BatchField_fld_Sequence)<br />
                    If oBkpTempRec.Fields(i)  oSrcTempRec.Fields(i) Then<br />
                        oBkpTempRec.Fields(i) = oSrcTempRec.Fields(i)<br />
                    End If<br />
                Next<br />
            End If<br />
            oBkpTempRecords.Save()<br />
        Next</p>
<p>        oBkpBatch.Save()</p>
<p>        oBkpTempRecords = Nothing</p>
<p>        oSrcBatch.CloseDown()<br />
        FinalReleaseComObject(oSrcBatch)</p>
<p>        oBkpBatch.CloseDown()<br />
        FinalReleaseComObject(oBkpBatch)<br />
    End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

