none
Problem with multivalue attribute during import RRS feed

  • Question

  • Hi!

    I am using a Extensible Connectivity 2.0 MA to import data from CRM Dynamics. I have created a schema which contains a multivalued attribute "schemaType.Attributes.Add(SchemaAttribute.CreateMultiValuedAttribute("Members", Microsoft.MetadirectoryServices.AttributeType.String));".

    When doing a full import I have made a Ilist<string> which I want to add to the attribute created above (Members), but it fails. "csentry1.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("Members",list));" gives the following exception:

    "The value type List`1 is not compatible with the attribute type String" with "System.Collections.ListDictionaryInternal".

    Have anyone encountered this or have any suggestion?

    Friday, July 27, 2012 10:59 AM

Answers

  • If I recall, you must use List<object> and not IList<string> or any other (contra|co)variant type.
    • Marked as answer by MorLarsen Tuesday, July 31, 2012 10:06 AM
    Monday, July 30, 2012 5:03 PM

All replies

  • I have the same problem. I'd love to see some sample ECMA 2 code for importing multivalued attributes.

    I've tried defining the attribute in the schema as a Reference type instead of a String, but that results in the same error. I've also attempted to add the members via one csentry per member without success.

    Monday, July 30, 2012 3:34 AM
  • If I recall, you must use List<object> and not IList<string> or any other (contra|co)variant type.
    • Marked as answer by MorLarsen Tuesday, July 31, 2012 10:06 AM
    Monday, July 30, 2012 5:03 PM
  • It worked when I changed the list type to object. Thanks Steve!

    Morten

    Tuesday, July 31, 2012 10:07 AM
  • hello Steve;

    i am trying to do the import for the members attribute using a Extensible Connectivity 2.0 MA to import data from SQL instead. I have created a schema which contains a multivalued attribute, I would appreciate to help me with following:

    1- the schema = should be like "schemaType.Attributes.Add(SchemaAttribute.CreateMultiValuedAttribute("Members", Microsoft.MetadirectoryServices.AttributeType.String));" or "SchemaAttribute.CreateMultiValuedAttribute("Member", AttributeType.Reference);"

    2- would you provide the sample code of the GetImportEntries(GetImportEntriesRunStep importRunStep) 

    Thanks,

    Loai K.Dawood

    Wednesday, November 13, 2013 7:15 AM