views:

176

answers:

1

Hi i'm having problems assigning a value to a custom field.

  • i've added multiple custom fields to our Dynamics CRM 4.0 installation. i've pressed publish.

  • I've gone to Settings -> Customization -> Download Web Description Files, and downloaded the wsdl replacing my current one in the project

  • I've pressed Update Web Reference

In my code I recieve the BusinessEntity

opportunity o = (opportunity)crmService.Retrieve(EntityName.opportunity.ToString(), guid, new AllColumns());

I am aware that getting AllColumns is bad practice

When I then try and assign a value to a custom property like this

o.custom_stringproperty = "string value";

I get the following error when trying to compile

'CrmProxy.CrmSdk.opportunity' does not contain a definition for 'custom_stringproperty' and no extension method 'custom_stringproperty' accepting a first argument of type 'CrmProxy.CrmSdk.opportunity' could be found (are you missing a using directive or an assembly reference?)

In Reference.cs the property is there in the opportunity class, intellisense shows the actual field when i look into the o. object.

I can't for the life of me figure out what causes this, i've removed the reference and added it again, i've cleaned the project and rebuild it. i've tried lots of things, I hope anyone here can point me in the right direction or knows the cause for this error.

A: 

I found out what caused this error, I also use parts of this project in SSIS and thus have it deployed in the GAC, the solution I where trying to compile had the proper project included, but for some reason looked in the GAC when doing a compile, and looked in the project when doing intellisense. thus when I deployed the updated version of the project into GAC to use it in SSIS, the compile error went away because the project dll and the gac version now where the same.

thmsn