using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

crm

    Sponsored Links

    Next

  • 1. CRM 4.0 Sample Code required for task entity's PreDelete event
    Hi Can i get sample code for the PreDelete Plugin of the Task Entity.
  • 2. Refreshing Grid from button.
    Hi: I added a button to one of the CRM entity dialogs. Basically user is able to select several items from the grid and then press the button which causes some processing and changes the state of selected entities. I am trying to force a refresh of the grid after the processing is done. I bring up a dialog which is visible for a few seconds and then it disappears (i.e. Processing ..... ). I tried using window.opener and several variations of that. However when I debug opener is always null. Anybody know how to force the refresh from the dialog. I am pretty sure that I had tried something like this in CRM 3.0 but the opener being null when I do this in CRM 4.0 is what has me confused. Thanks for any help. Artes
  • 3. Assign new owner to Incident
    Hi, please can someone help with the following. I get a SOAPException when trying to execute the request. I have looked at the SDK samples and in the newsgroups but everything seems to be correct? SecurityPrincipal assignee = new SecurityPrincipal(); assignee.Type = SecurityPrincipalType.User; systemuser su = (systemuser)userEntities.BusinessEntities[0]; assignee.PrincipalId = su.systemuserid.Value; TargetOwnedIncident target = new TargetOwnedIncident(); target.EntityId = caseID; AssignRequest assign = new AssignRequest(); assign.Assignee = assignee; assign.Target = target; AssignResponse assignResponse = (AssignResponse)
  • 4. Show fields when checkbox selected
    Is there any way to show newly created fields when we select the CheckBox. as i have created a new Section in CRM 3.0 under details's tab. for example i have created a section as Banks with Checkbox. when we select Banks(Optional as CheckBox) a Text field & description field should appear otherwise Text Field & description field should be hidden. I strongly believe that i need to write code (could you hellp me to write code). Regards, SAB.

using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

Postby ZG9taW5pa19odWc » Wed, 22 Jul 2009 22:59:01 GMT

i all

I want to use the Enterprise Library 4.1 Logging Block to make the tracing
in a Custom Workflow Activity (CWA).
I have written a CrmAsyncService.exe.config as configuration file (reading
settings out of this file from a CWA works.

In the project I referenced the
Microsoft.Practices.EnterpriseLibrary.Logging.dll with "Copy Local" set to
true. In the Windows Explorer in the properties of the assembly I can see
that it is a signed assembly.

I copied the assembly Microsoft.Practices.EnterpriseLibrary.Logging.dll
along with
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.ObjectBuilder2.dll
Microsoft.Practices.Unity.dll
in the bin\assembly folder of CRM.

But every time the CWA ist executed I have the following error in the trace
output of CRM:

[2009-07-21 14:52:26.9] Process:CrmAsyncService
|Organization:a6cc8da2-b53a-47b8-b732-ffa29982cfb1 |Thread: 4 |Category:
Platform.Workflow |User: 00000000-0000-0000-0000-000000000000 |Level: Error |
WorkflowHost.OnWorkflowTerminated
at WorkflowHost.OnWorkflowTerminated(Object sender,
WorkflowTerminatedEventArgs args)
at WorkflowRuntime.OnScheduleTerminated(WorkflowExecutor schedule,
WorkflowTerminatedEventArgs args)
at WorkflowRuntime.WorkflowExecutionEvent(Object sender,
WorkflowExecutionEventArgs e)
at EventHandler`1.Invoke(Object sender, TEventArgs e)
at WorkflowExecutor.FireWorkflowTerminated(Exception exception)
at SchedulerLockGuard.FireEvents(List`1 eventList, WorkflowExecutor
workflowExec)
at SchedulerLockGuard.Dispose()
at WorkflowExecutor.RunSome(Object ignored)
at WorkItem.Invoke(WorkflowSchedulerService service)
at DefaultWorkflowSchedulerService.QueueWorkerProcess(Object state)
at _ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at ExecutionContext.runTryCode(Object userData)
at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code,
CleanupCode backoutCode, Object userData)
at ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
at
_ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback
tpWaitCallBack)
at _ThreadPoolWaitCallback.PerformWaitCallback(Object state)
File name: 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at
System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord
configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
at
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary

RE: using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

Postby ZG9taW5pa19odWc » Fri, 24 Jul 2009 00:36:01 GMT

found the solution my self:

Adding
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="assembly"/>
</assemblyBinding>
</runtime>
to the CrmAsyncService.exe.config helped.
Interestingly in the Plugins and CustomWorkflowActities I also reference an
assembly
I developed my self and the calling assembly managed to locate it (without
the probing element).

"dominik_hug" wrote:


Similar Threads:

1.CRM Callouts & Microsoft Enterprise Library Application Blocks

We are writing a callout for a project and we would like to use the Microsoft 
Enterprise Library (MEL) for configuration, logging, and data access.  It is 
our enterprise standard to utilize those blocks for those activities on all 
of our efforts.  The problem is that I don't see a readily available 
app.config or web.config file for which I can add the configuration context 
necessary to utilize those features.

I also am very averse to modifying any core Microsoft Dynamics CRM 3.0 
app.config or web.config file because it has the potential of being wiped out 
during any future upgrades.  So far we have envisioned two options but would 
like some community feedback to help us define a best practice.

Option 1: Use the MEL ConfigurationManager to load context from a file and 
execute against that context
PRO: It seems as if it may get us closer 
CON: Externally loaded context does not become the "current context".  
Existing in-house libraries hard-wired to execute against the "current 
context" may not be utilized.

Option 2: Add the configuration context to the machine.config
PRO: We may utlize all existing in-house libraries 
CON: We have a standard to not use the machine.config for anything to avoid 
potential maintenance headaches.

We are leaning towards [Option 2] and changing our standard to allow 
authorized modifications to the machine.config only.  This is because we 
enjoy leveraging the current context in our core libraries to avoid having to 
pass context and configuration information through every layer of our code.


2.is it possible to have a multiple Lookup in a custom Workflow acti

3.How to get logged in user GUID in custom component using mscrm 3.0

I am using this code to retrive GUID but it's always return same GUID of 
system user(named SYSTEM in the systemuserbase table).

CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

WhoAmIRequest userRequest = new WhoAmIRequest();
WhoAmIResponse user = (WhoAmIResponse) service.Execute(userRequest);
String loggedInUserId = user.UserId.ToString();

I think it is the case of setting the impersonation in the CRM web.config 
and the corresponding application web.config.

Any suggestion would be helpful.

4.How to get logged in user GUID in custom component using mscrm

Hi Tibor,

Thanks for your reply. As you written in step 1 impersonate your user that i 
already done through web.config(<identity impersonate="true" />)

Please explain these steps in some more detail. If you have any sample code 
regarding to this thats is very helpful for me.

Many thanks for your help.

Kedar N. Kumar

"Tibor" wrote:

> Hi Kumar,
> 
> you can use service.caller.callerguid to get/set this property.
> But the call-outs are running under the name of NT AUTHORITY\Network Service 
> = (SYSTEM)
> You can do the following:
> - imersonate your user user using the Credentialcache
> - find you user through crm webservice in the database
> - retrieve the id of your user
> - log this id.
> 
> Regards,
> Tibor
> 
> "Kedar Nath Kumar" wrote:
> 
> > I am using this code to retrive GUID but it's always return same GUID of 
> > system user(named SYSTEM in the systemuserbase table).
> > 
> > CrmService service = new CrmService();
> > service.Credentials = System.Net.CredentialCache.DefaultCredentials;
> > 
> > WhoAmIRequest userRequest = new WhoAmIRequest();
> > WhoAmIResponse user = (WhoAmIResponse) service.Execute(userRequest);
> > String loggedInUserId = user.UserId.ToString();
> > 
> > I think it is the case of setting the impersonation in the CRM web.config 
> > and the corresponding application web.config.
> > 
> > Any suggestion would be helpful.

5.Word templates using WSS as document library

6. Outbound email blocked as SPAM when using the CRM4.0 router

7. Custom Libraries in CRM4.0

8. Calling assembly from workflow - blocking problem?



Return to crm

 

Who is online

Users browsing this forum: No registered users and 96 guest