Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Programmatically adding ListItems with a BDC column

  Asked By: Jordan Cooper         Date: Mar 25, 2007      Category: Sharepoint      Views: 650
 

I have a custom list that contains a Business Data Catalog (BDC)
colunm. When I programatically add an item to the list through the
object model (OM) SharePoint seems to accept the value I enter into
the BDC colunm but when I view the item through the SharePoint UI
there is no value displayed in the BDC column. However, when I then
view the item through the OM the value is clearly displayed in the
BDC column.

If I create another list item through the SharePoint UI and save the
same value in the BDC column it dislpays the item along with the BDC
data as expected. If I then view this new item in the OM, it displays
exactly the same value in the BDC column as the one I created
programmatically. This suggests to me that when the item is created
through the SharePoint UI an extra/different process is invoked
compared to how I am creating the item through the OM as follows;

SPListItem newIssue = _<SPList>.Items.Add();
newIssue["Sickness Id"] = _employeeSicknessId;
newIssue["Employee"] = _currentSPUser.ID;
newIssue["Title"] = string.Format("sickness_{0}_{1}",
DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHmmss"));
newIssue["Sickness"] = _employeeSicknessId; // BDC colunm
newIssue.Update();


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:            

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Programmatically adding ListItems with a BDC column Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].