Send strings to Dynamic CRM and let it figure the types out? -
i need push changes sql server database crm. there 2 tables on sql side:
transfer
- transferid (sequential)
- entity (string, sql table name)
- pkofentity (int, table)
- action (create, update, destroy)
transferfield
- fieldid (sequential)
- transferid (foreign key)
- fieldname (string)
- fieldvalue (string)
now, need these changes crm. have mapping of sql tables crm entities, , 1 of sql columns crm attributes. not, however, have mapping of crm attributes crm types on hand.
i'm using microsoft.xrm.sdk.client.organizationservicecontext object. setattributevalue method takes object, doesn't conversions; int field requires passing in int, , on. now, really, really, able pass in field names , values dynamically strings in 1 simple foreach, rather manually checking , setting dozens of attributes dozens of models. there reasonable way of doing this?
i have working. each type of entity come across, entity metadata crm, , build dictionary attribute names attributetypecodes. have function switches on type code , returns correct type of object.
Comments
Post a Comment