Skip to Content
Former Member
Jul 25, 2012 at 02:04 PM

Custom Web Part update on BCS Model


I've created the following scenario: I have created a Visual Web Part with an updatable GridView. I created some classes to call to the BCS-DUET models. Query and Insert work perfect. Update has some troubles, with 1 data modification it works as expected. When I update multiple records it does not. I update these records via a loop and call the class per loop-instance, only the first instance is updated. There is no difference in logic between 1 record or 2 records as far i can see.

I'm using this tutorial as a reference :

When I look in SRTUTIL i see 2 entries and it seems it has run successfully (2 green indicators). When I look into the payloads the data is also what I expected. The one thing that strikes me is that the IV_BCSCORRELATIONID is the same. When I retest the payload with SPROXY it gives me the same result (no update). When I slightly modify the GUID the update runs through.

I tried to force the GUID in the class:

ITypeDescriptor bcsCorrelationIdTypeDescriptor = rootTypeDescriptor.GetChildTypeDescriptors()[1];

reflector.Set(bcsCorrelationIdTypeDescriptor, rootTypeDescriptor, ref instance, guid);

No effect.

Now when testing the same BCS classes via a test Console application it works!

Apparently i'm stuck in a sort-of SharePoint cache/environment and i cannot override the IV_BCSCORRELATIONID.

Can someone help me on this? Any suggestion is welcome!