Table Structure Not Updating On EDMX

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
MarcJ
Posts: 1
Joined: Mon 05 Aug 2013 17:30

Table Structure Not Updating On EDMX

Post by MarcJ » Mon 05 Aug 2013 17:35

We are using the connector with Entity Framework. Once the EDMX has been generated, if the table structure in Salesforce changes, updating the EDMX doesn't seem to add any new fields to the tables that have already been added to the EMDX. In fact, if we remove all of the tables from the EDMX and do an "update model from database" and re-add the tables, they still will not have the new fields. Is the structure being cached? If so, how do we clear the cache to allow the update to see the new fields?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Table Structure Not Updating On EDMX

Post by Shalex » Tue 06 Aug 2013 08:17

Please check if a new column exists in the database via web interface of http://www.salesforce.com.

If the column does exist in the database, the reason of the problem with its availability in client application is that your local metadata cache is out-of-date: http://www.devart.com/dotconnect/salesf ... rview.html. In this case, there are alternative ways to solve the issue:
1) execute the code:

Code: Select all

SalesforceConnection conn = new SalesforceConnection(connString);
conn.Open();
conn.Cache.RefreshMetadata();
2) the "Refresh Metadata=true;" connection string parameter causes a refresh of Salesforce metadata each time when the connection is opened. Leads to the performance loses.
3) remove the C:\Users\YOUR_OS_USER_NAME\Application Data\*.db files. dotConnect for Salesforce will recreate them on the next connection.Open().

If the column does exist and it is a system field, you should add "System Objects=true;" to your connection string (and call conn.Cache.RefreshMetadata() after this) to have access to the system fields of the Salesforce objects.

Post Reply