<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.blackbaud.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag '.NET'</title><link>http://forums.blackbaud.com/search/SearchResults.aspx?o=DateDescending&amp;tag=.NET&amp;orTags=0</link><description>Search results matching tag '.NET'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP2 (Debug Build: 20611.960)</generator><item><title>Search for Constituents by bank account</title><link>http://forums.blackbaud.com/forums/p/10329/37567.aspx#37567</link><pubDate>Sun, 19 Oct 2008 16:58:38 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:37567</guid><dc:creator>51CA828C-2740-4A43-8ABA-E04CEF1FE4D2</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking for a way to find contstituents by their bank account.&lt;/p&gt;
&lt;p&gt;As off version 7.81 the account numbers are encrypted in the DB. &lt;br /&gt;Using the standard CustomWhereClause doesn&amp;#39;t work because it queries the raw (encrypted) data.&lt;/p&gt;
&lt;p&gt;Is there a way to encrypt the plain text (account no) and pass that in the customwhereclause ?&lt;br /&gt;Or another filter object&amp;nbsp;where I can give the account no in plain text as a parameter that returns a constituent collection ?&lt;/p&gt;
&lt;p&gt;Eric&lt;/p&gt;</description></item><item><title>API using Visual Studio 2005</title><link>http://forums.blackbaud.com/forums/p/9697/32569.aspx#32569</link><pubDate>Thu, 07 Aug 2008 00:45:47 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:32569</guid><dc:creator>68C4F98C-B35E-4740-A85A-3ED5FACE6A3A</dc:creator><description>&lt;p&gt;I am writing an app in Vb using Visual Studio 2005 and the RE API and have run into a problem displaying a Constituent form. Strangely I have been able to display an RE&amp;nbsp;Gift form in exactly the same environment and with nearly identical code. Has anyone come upon similar problems?&lt;/p&gt;
&lt;p&gt;The details are ...&lt;/p&gt;
&lt;p&gt;Code&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; oSuppForm &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; CConstituentForm, oRec &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; CRecord&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;oRec.Init(REApplication.SessionContext)&lt;/p&gt;
&lt;p&gt;oRec.Load(iRERecID)&lt;/p&gt;oSuppForm = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; CConstituentForm&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;oSuppForm.Init(REApplication.SessionContext)&lt;/p&gt;
&lt;p&gt;oSuppForm.ConstituentObject = oRec&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;oSuppForm.ShowForm(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;True&lt;/font&gt;&lt;font size="2"&gt;, , &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;True&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;end code&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Error message displayed is &lt;strong&gt;Attempt to access the method failed&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The same error occurs when I use ShowFormOkCancel as well.&lt;/p&gt;
&lt;p&gt;Blackbaud technical support had no problems running the code. &lt;/p&gt;
&lt;p&gt;Has anyone experienced anything similar? Hopefully with a solution?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Peter&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;</description></item><item><title>Solved</title><link>http://forums.blackbaud.com/forums/p/9257/31552.aspx#31552</link><pubDate>Fri, 20 Jun 2008 04:22:19 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:31552</guid><dc:creator>8EEBEEEC-7313-4680-B747-D0E1F7563572</dc:creator><description>&lt;p&gt;Ok I have it finally working!&lt;br /&gt;&lt;br /&gt;The main thing to check for is to go via the RE client into Config -&amp;gt; Fields and check whether all fields, that are marked as required, are provided for in the code. If any of those fields are missing, the API will throw up an error.&lt;br /&gt;&lt;br /&gt;Upon looking at the exception, the Source property will tell you which object the error applies to. In my case, it was CProspect. Hence I gave Prospect a value and it worked!&lt;/p&gt;
&lt;p&gt;&lt;a id="lightboxlink0" href="http://www.blackbus.org/forum/attachments/api-vba/201d1213935084-api-help-net-exception.jpg"&gt;&lt;img id="lightboximg0" title="Exception.jpg; &amp;#10;345 x 135 (@100%)" height="135" alt="" src="http://www.blackbus.org/forum/attachments/api-vba/201d1213935084-api-help-net-exception.jpg" width="345" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: API Help in .Net - Create Constituent</title><link>http://forums.blackbaud.com/forums/p/9257/31551.aspx#31551</link><pubDate>Fri, 20 Jun 2008 04:20:50 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:31551</guid><dc:creator>8EEBEEEC-7313-4680-B747-D0E1F7563572</dc:creator><description>&lt;p&gt;Ok I have it finally working! The main thing to check for is to go via the RE client into Config -&amp;gt; Fields and check whether all fields, that are marked as required, are provided for in the code. If any of those fields are missing, the API will throw up an error. Upon looking at the exception, the Source property will tell you which object the error applies to. In my case, it was CProspect. Hence I gave Prospect a value and it worked! &lt;/p&gt;
&lt;p&gt;&lt;a id="lightboxlink0" href="http://www.blackbus.org/forum/attachments/api-vba/201d1213935084-api-help-net-exception.jpg"&gt;&lt;img id="lightboximg0" title="Exception.jpg; &amp;#10;345 x 135 (@100%)" height="135" alt="" src="http://www.blackbus.org/forum/attachments/api-vba/201d1213935084-api-help-net-exception.jpg" width="345" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: API Help in .Net - Create Constituent</title><link>http://forums.blackbaud.com/forums/p/9257/31548.aspx#31548</link><pubDate>Thu, 19 Jun 2008 23:26:44 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:31548</guid><dc:creator>8EEBEEEC-7313-4680-B747-D0E1F7563572</dc:creator><description>&lt;p&gt;There seems to be some confusion. I am not updating data via the database, I just tried it to see if there were any constraints.&lt;/p&gt;
&lt;p&gt;The key field is RECORDS_fld_IS_CONSTITUENT which, if set to true, fails but if set to false works, but only inserts a row in the records table, NOT in the Constituent table. If anyone has been able to successfully create a row in the Constituent table, please help!&lt;/p&gt;&lt;code&gt;
&lt;p&gt;The error is : System.Runtime.InteropServices.COMException (0x80040666): Required Field Missing:&amp;nbsp; Status&lt;br /&gt;&amp;nbsp;&amp;nbsp; at BBREAPI7.CRecordClass.Save()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried in vain to find a Status field both in the Records table and the &lt;font color="#2b91af" size="2"&gt;ERECORDSFields &lt;font color="#000000"&gt;enumeration.&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;Here is the full text of my code:&lt;/p&gt;&lt;font size="2"&gt;_record = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;CRecord&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_context = _api.SessionContext;&lt;/p&gt;_record.Init(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ref&lt;/font&gt;&lt;font size="2"&gt; _context);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// _record.set_Fields(ERECORDSFields.RECORDS_fld_CONSTITUENT_ID, id);&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_CONSTITUENT_CODE, constituentCode);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_FIRST_NAME, firstName);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_MIDDLE_NAME, middleName);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; _record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_LAST_NAME, lastName);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_GENDER, gender);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;// this works if the value is false but does not if it is true&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_IS_CONSTITUENT, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;false&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_KEY_INDICATOR, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;I&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; _record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_SOCIAL_SECURITY_NO, SSN);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_TITLE_1, title1);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_SUFFIX_1, suffix1);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_BIRTH_DATE, birthDate);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_BIRTHPLACE, birthPlace);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_ETHNICITY, ethnicity);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_MARITAL_STATUS, maritalStatus);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; _record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_PRIMARY_ADDRESSEE_ID, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_PRIMARY_SALUTATION_ID, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;16&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_PRIMARY_ADDRESSEE_EDIT, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;false&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//_record.set_Fields(ERECORDSFields.RECORDS_fld_PRIMARY_ADDRESSEE, &amp;quot;-&amp;quot;);&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_PRIMARY_SALUTATION_EDIT, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;false&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//_record.set_Fields(ERECORDSFields.RECORDS_fld_PRIMARY_SALUTATION, &amp;quot;mr&amp;quot;);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (deceasedDate.HasValue)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_DECEASED_DATE, deceasedDate.Value);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;_record.set_Fields(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ERECORDSFields&lt;/font&gt;&lt;font size="2"&gt;.RECORDS_fld_DECEASED, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;_record.Save();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;finally&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;_record.CloseDown();&lt;/p&gt;System.Runtime.InteropServices.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Marshal&lt;/font&gt;&lt;font size="2"&gt;.ReleaseComObject(_record);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/code&gt;</description></item><item><title>Re: API Help in .Net - Create Constituent</title><link>http://forums.blackbaud.com/forums/p/9257/31546.aspx#31546</link><pubDate>Thu, 19 Jun 2008 22:22:50 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:31546</guid><dc:creator>8EEBEEEC-7313-4680-B747-D0E1F7563572</dc:creator><description>&lt;p&gt;I tried removing the CONSTITUENT_CODE_fld_CONSTIT_ID assignment but I get this error:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;System.Runtime.InteropServices.COMException (0x80040666): Required Field Missing: Status&lt;br /&gt;at BBREAPI7.CRecordClass.Save()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I did some more investigation yesterday and discovered that if I set:&lt;br /&gt;&lt;/p&gt;
&lt;div style="MARGIN:5px 20px 20px;"&gt;
&lt;div class="smallfont" style="MARGIN-BOTTOM:2px;"&gt;Code:&lt;/div&gt;&lt;pre class="alt2" style="BORDER-RIGHT:1px inset;PADDING-RIGHT:6px;BORDER-TOP:1px inset;PADDING-LEFT:6px;PADDING-BOTTOM:6px;MARGIN:0px;OVERFLOW:auto;BORDER-LEFT:1px inset;WIDTH:640px;PADDING-TOP:6px;BORDER-BOTTOM:1px inset;HEIGHT:34px;TEXT-ALIGN:left;"&gt;&lt;font color="black"&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_IS_CONSTITUENT, &amp;quot;false&amp;quot;);&lt;/font&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;font color="#000000"&gt;it works, and a record gets created in the Records table but if that variable is set to true, it throws up an error. I then tried a SQL update statement on the Records table to set the IS_CONSTITUENT field to true and it threw up a constraint error. &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#000000"&gt;It seems that if IS_CONSTITUENT = true, it needs a row in the Constituent table as well.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;I rechecked the API and cannot find a way to create a constituent in the constituent table. This is very frustrating!! &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="black"&gt;If anyone has been able to create a constituent via the API, please help&lt;/font&gt;&lt;/p&gt;</description></item><item><title>API Help in .Net - Create Constituent</title><link>http://forums.blackbaud.com/forums/p/9257/31525.aspx#31525</link><pubDate>Thu, 19 Jun 2008 02:54:07 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:31525</guid><dc:creator>8EEBEEEC-7313-4680-B747-D0E1F7563572</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;My client has purchased Raiser&amp;#39;s Edge and requires external systems to integrate their data with RE.&lt;br /&gt;I am writing .Net code to manipulate the API to create new constituents but am running into a problem.&lt;br /&gt;I tried all the help manuals but am unsure what to do. Code is as follows:&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IBBSessionContext _context;&lt;br /&gt;private CRecord _record = new CRecord();&lt;br /&gt;.....&lt;br /&gt;&lt;br /&gt;_record = new CRecord();&lt;br /&gt;_record.Init(ref _context);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_CONSTITUENT_ID, id);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_CONSTITUENT_CODE, constituentCode);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_FIRST_NAME, firstName);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_MIDDLE_NAME, middleName);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_LAST_NAME, lastName);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_SOCIAL_SECURITY_NO, SSN);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_TITLE_1, title1);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_SUFFIX_1, suffix1);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_BIRTH_DATE, birthDate);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_BIRTHPLACE, birthPlace);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_ETHNICITY, ethnicity);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_MARITAL_STATUS, maritalStatus);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_GENDER, gender);&lt;br /&gt;&lt;br /&gt;CConstituentCode cCode = _record.ConstituentCodes.Add();&lt;br /&gt;cCode.set_Fields(ECONSTITUENT_CODEFields.CONSTITUENT_CODE_fld_CODE, &amp;quot;Staff&amp;quot;);&lt;br /&gt;cCode.set_Fields(ECONSTITUENT_CODEFields.CONSTITUENT_CODE_fld_CONSTIT_ID, &amp;quot;Staff&amp;quot;);&lt;br /&gt;if (deceasedDate.HasValue)&lt;br /&gt;{&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_DECEASED_DATE, deceasedDate.Value);&lt;br /&gt;_record.set_Fields(ERECORDSFields.RECORDS_fld_DECEASED, &amp;quot;1&amp;quot;);&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;_record.Save();&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;When save gets called, I get an exception with the following message:&lt;br /&gt;&amp;quot; System.Runtime.InteropServices.COMException (0x80040666): Required Field Missing: Constituent Code&lt;br /&gt;at BBREAPI7.CRecordClass.Save()&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#000000"&gt;I know why it is complaining about the Constituent code as I get the same message when I try to create a new constituent from the Raiser&amp;#39;s Edge UI. Can someone help me with adding a constituent code to the CRecord object please?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>