.NET Assembly and TypeDescriptors...
Hey all...
Have been fighting with a .NET Assembly and two entities. The entities are fairly run of the mill database tables in SQL Server.
For a few particular reasons, I switched to a .NET Assembly using the Entity Framework to access the two related database tables. I'm also using POCO objects (simple C# classes) exposed to the BDC model rather than directly passing the EF objects to the BDC model. I did this because I kept running into road blocks with the EF and the SharePoint model.
Anyway, at this point, using my .NET Assembly and my POCO classes, I'm finding that the SharePoint GUI (External List connected to the External Content Type) is very sporadic when responding to my typedescriptor entries.
In this particular example, I wanted to set the "CompanyName" field for the company entity to required and, set a maximum size to 50 characters.
So, per the documentation (all over the web) I was able to locate, I added two custom properties to the ReadItem method (specific finder) as follows:
<TypeDescriptor Name="CompanyName" TypeName="System.String">
<Properties>
<Property Name="Size" Type="System.Int32">50</Property>
<Property Name="RequiredInForms" Type="System.Boolean">true</Property>
</Properties>
<Interpretation>
<NormalizeString FromLOB="NormalizeToNull" ToLOB="NormalizeToEmptyString" />
</Interpretation>
</TypeDescriptor>
That didn't seem to do anything, so I put it on my ReadList, ReadItem, Updater and Creator methods also for the typedescriptor for this field.
Eventually (not sure when it started), the CompanyName field responded to the "RequiredInForms" inside SharePoint (standard external list editor form) by showing up with the red * beside the field.
Still not sure which view (ReadItem, ReadList etc) should have the RequiredInForms setting, but it seems to work.
The Size property does not work. The company name field can only contain 50 characters max. The Size property is set to 50 max and it allows 50 plus characters.
Any thoughts?
|