External Data Column (part 1)

In a previous post you can see I attached an event receiver to a specific list. This list contains an external data column. In the event receiver method ItemAdding I added following code.

image
First of all I get the External Content Type – in the future I want to attach this event receiver to all document libraries so in the code I use the name of my list to search for my content type.
In the library there is a folder with a name, this name is the identifier I use in my External Content Type.
So, at the moment an item is being added to the folder in the list, I perform a lookup to the folder name and try to retrieve it from my External Content Type.
Once retrieved, add it by using EntityInstanceIdEncoder.EncodeEntityInstanceId(new object[] { foldername });

Next up add a external data column to an list instance.

Reacties

Populaire posts