Solved

Retrieved custom entity properties are not returned when they're empty (V4.0)

Posted on 2008-06-13
2
453 Views
Last Modified: 2013-11-24
My webservice retrieves custom CRM entities and decides if certain properties need to be updated from an external source. It seems that whenever properties in CRM are empty (certainly string properties - I've yet to test other property types) they aren't returned in my DynamicEntity. My logic is being driven by properties returned and decides what needs to be updated, so any empty string properties never get updated! See snippet. Thanks for any advice/suggestions.
Dim query As New QueryExpression

query.EntityName = "my_entity"

query.ColumnSet = New AllColumns

Dim condition1 As New ConditionExpression

condition1.AttributeName = sExistingEntityKey

condition1.Operator = ConditionOperator.Equal

condition1.Values = New String() {sLookupKey}

Dim childFilter As New FilterExpression

childFilter.FilterOperator = LogicalOperator.And

childFilter.Conditions = New ConditionExpression() {condition1}

query.Criteria = childFilter

Dim retrieve As New RetrieveMultipleRequest()

retrieve.Query = query

retrieve.ReturnDynamicEntities = True

Dim retrieved As RetrieveMultipleResponse = CType(crmServ.Execute(retrieve), RetrieveMultipleResponse)

If retrieved.BusinessEntityCollection.BusinessEntities.Length > 0 Then

   Dim entity As New DynamicEntity

   Dim retrievedEntity As DynamicEntity = CType(retrieved.BusinessEntityCollection.BusinessEntities(0), DynamicEntity)

   For i = 0 To retrievedEntity.Properties.Length - 1

      If retrievedEntity.Properties(i).Name = "[property name I know must be updated]" Then

      update property...

      crmServ.Update(retrievedEntity)

and so on...

Open in new window

0
Comment
Question by:touch-base
2 Comments
 
LVL 9

Accepted Solution

by:
Biffster007 earned 500 total points
ID: 21789762
Hi,

If you know the entity that you'll be working with why don't you create an instance of that than you'll have access to all the fields??

Che,
MH
0
 
LVL 1

Author Closing Comment

by:touch-base
ID: 31466858
I'd been hunting for an obscure property or method that might return ALL columns regardless of content but I'll now follow your suggestion! Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello All, In previous article we used Hortonworks sandbox to work with Hadoop. Now, lets think to create own single node Hadoop on Linux. Here we Install and Configure Apache Hadoop on UI based Oracle Linux. I assume, you have VMware installe…
Note: You must have administrative privileges in order to create/edit Roles. Salesforce.com (http://www.salesforce.com/) (SFDC) is a cloud-based customer relationship management (CRM) system. It is a database most commonly used by sales and marke…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now