Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Custom Workflow

Posted on by 1,695

I'm generating a custom workflow to generate and send out reports to clients. 

The calling entity (new_remittanceadvice has two GUIDs that I need to get in the workflow to pass through to the report.

One is easy as its the primaryEntityId , my problem is how to get the guid from new_suppierrefid

code so far ;

 Dim tracingService = executionContext.GetExtension(Of ITracingService)()
                Dim workflowContext = executionContext.GetExtension(Of IWorkflowContext)()
                Dim context As IWorkflowContext = executionContext.GetExtension(Of IWorkflowContext)()
                Dim serviceFactory As IOrganizationServiceFactory = executionContext.GetExtension(Of IOrganizationServiceFactory)()
                Dim service As IOrganizationService = serviceFactory.CreateOrganizationService(context.UserId)

 Dim targetEntityImage As Entity = DirectCast(workflowContext.InputParameters("Target"), Entity)

' Prepare report parameter.
                Dim parameters(1) As ReportServer.ParameterValue
                ' Set Report ID
                parameters(0) = New ReportServer.ParameterValue()
                parameters(0).Name = "remittanceadvicesid"
                parameters(0).Value = context.PrimaryEntityId.ToString


*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans