Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:37:02+00:00 2026-05-29T15:37:02+00:00

I have a C# workflow that I’m trying to create an IOrganzationService in that

  • 0

I have a C# workflow that I’m trying to create an IOrganzationService in that has the proxy types enabled on it so I can use my early bound data types…

This is how I’m creating the IOrganizationSerivce

IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

But since I don’t have an OrganizationServiceProxy object, I can’t call EnableProxyTypes() on the service, and any create calls on the service using an early bound entity fails.

I know I can revert to setting the server url url, sdk server url, and organization in the app.config and use that to create an OrganizationServiceProxy but it seems like I should be able to just set the EnableProxyTypes on the IOrganizationService that I already have…

Update

I believe this was a bug in 2011 and maybe 2013 that has long since been resolved. See Jim’s answer with a link as to why you should not be using the accepted answer for 2015 or newer instances.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:37:04+00:00Added an answer on May 29, 2026 at 3:37 pm

    To be able to use the early bound entities in the context of an workflow try the following snippet:

    IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
    IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
    
    var type = Type.GetType("Microsoft.Crm.Workflow.SynchronousRuntime.WorkflowContext, Microsoft.Crm.Workflow, Version=5.0.0.0");
    type.GetProperty("ProxyTypesAssembly").SetValue(serviceFactory, typeof(YourServiceContext).Assembly, null); //YourServiceContext - the name of crm context
    IOrganizationService service = serviceFactory.CreateOrganizationService(context.InitiatingUserId); 
    

    As you can see there is a property named ProxyTypesAssembly that specifies the assembly where you keep the early bound entities. The only way i could set this property was using reflection because the WorkflowContextBase (the base class of WorkflowContext) was not accessible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a workflow that has a 'Prompt and Response' dialogue. I can run
I have a skelta workflow that has finished with errors according to the WorkflowExecutionReport.
I have a very simple workflow that is just trying to send an email
I have a Workflow 4 activity that can be run on any number of
I have a workflow that moves files around between ftp sites. It can be
Let's say I have a Workflow in Sitecore that has the following states: Draft
AI have a WF 4 application which contains a sequence workflow that has a
I have a workflow that has a public State property that returns a custom
I have a fairly straight-forward sequential approval workflow that has an EnableModificationActivity that is
Currently we have a sequential workflow in sharepoint 2010 that has a delay activity.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.