Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

brain freeze - workflow to update a record

$
0
0

CRm2016 On premises

Im having a brain freeze trying to update a record in a workflow. I have the ID of the record as a string , tried convering to guid  but just get errors Unable to cast object of type 'System.Guid' to type 'Microsoft.Xrm.Sdk.EntityReference'.

Public Shared Function UpdateRecord(_recordid As string, service As IOrganizationService, context As CodeActivityContext) As Boolean

            Try

                Dim _updaterecord As Entity = New Entity("new_dbfmlivedata")

                _updaterecord.Id = _recordid

                _updaterecord.Attributes.Add("new_processing", True)

                service.Update(_updaterecord)

                Return True

            Catch ex As Exception

                Globals.clsGlobals.WrtietoErrorLog("UpdateRecord " & ex.Message.ToString)

                Return False

            End Try

            Return False

        End Function


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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