Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Set Lookup field to null programmatically in CRM 2011

$
0
0

Hi ,

I am trying to clear the lookup value to null programatically through plug-in but no luck.

I am writing th ebelow line of code.

            Dim recordUpdated AsBoolean =

False

           

Dim objEntity As Entity =

Nothing

           

Dim objParentCOntactRleation As EntityReference =

Nothing

           

Try

               

'Create Entity

                objEntity =

New

Entity(CNT_CONTACTRELATIONS)

                objParentCOntactRleation =

New

EntityReference()

               

'Add Properties to entity

                objEntity.Id =

New

Guid(strGUID)

                objEntity.Attributes.Add(CNT_COPIEDCONTACTRELATION,

False

)

                

objEntity(CNT_PARENTCONTACTRELATIONID) = New EntityReference(String.Empty, Guid.Empty)

//Eevn i tried by setting the lookup attribute to to NULL but no luck



                msCrmService.Update(objEntity)

           

Catch ex As

FaultException

               

Throw

ex

           

Catch ex As

Exception

               

Throw

ex

           

Finally

                objEntity =

Nothing

           

End

Try


Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>