creation enterprising entities ms crm 4.0


i am perplexing emanate new hit controlling enterprising entity. illustration i found crm sdk code.



// set properties hit controlling ability objects.
stringproperty firstname = new stringproperty();
firstname.name = "firstname";
firstname.value = "jesper";
stringproperty lastname = new stringproperty();
lastname.name = "lastname";
lastname.value = "aaberg";

// emanate dynamicentity object.
dynamicentity contactentity = new dynamicentity();

// set name entity type.
contactentity.name = entityname.contact.tostring();

// set properties contact.
contactentity.properties = new property[] {firstname, lastname};


in formula i have following implementation.



        stringproperty sp_field1 = new stringproperty("field1","value1");
stringproperty sp_field2 = new stringproperty("field2","value1");

crmservice use = new crmservice();
service.credentials = system.net.credentialcache.defaultcredentials;
// emanate dynamicentity object.
dynamicentity contactentity = new dynamicentity();
// set name entity type.
contactentity.name = entityname.contact.tostring();
// set properties contact.
contactentity.properties = new property[] {sp_field1,sp_field2};


i don't many differences code. examples i found internet i have same doing i found sdk. nonetheless i run same i following error




cs0029: can't many modify form 'microsoft.crm.sdk.stringproperty' 'microsoft.crm.sdk.propertycollection'




i attempted combined new non-static form propertycollection(one belongs mscrm namespace) total stringpropertys upheld entity.



microsoft.crm.sdk.propertycollection proptest = new microsoft.crm.sdk.propertycollection();
proptest.add(sp_ssnno);
proptest.add(sp_firstname);
contactentity.properties = new property[] {proptest};


this gave me following error




cs0029: can't many modify form 'microsoft.crm.sdk.propertycollection' 'microsoft.crm.sdk.property'




i am certain the teenager typecasting blunder nonetheless i am means figure out where blunder is. moreover, even typecasting blunder since operative samples given internet me. i attempted removing formula illustration run nonetheless i am encountering same reworking error. greatfully let me know need some-more info this, any assistance appreciated.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?