Where to find Server Address And Organization Name in plugin?

Where to find Server Address And Organization Name in plugin?

If you would create client application which use OrganizationServiceProxy answer to question is easy: var proxy = service as OrganizationServiceProxy; var scheme = proxy.EndpointSwitch.PrimaryEndpoint.Scheme; var serverAddress = proxy.EndpointSwitch.PrimaryEndpoint.Host; var organizationName = proxy.EndpointSwitch.PrimaryEndpoint.Segments.Length < 2 ? UndefinedValue : proxy.EndpointSwitch.PrimaryEndpoint.Segments[1].Replace("/", string.Empty); If you use LocalPluginContext organization name is available: localContext.PluginExecutionContext.OrganizationName But, what with other parameters, ex. servername […]

Get user personal settings: date & time format, date separator, number separator, decimal symbol, currency presision

Get user personal settings: date & time format, date separator, number separator, decimal symbol, currency presision

Info: If you have ever, I assume you must have, been annoyed with JS: reading date/time format reading date/time separator reading currency precision reading decimal symbol reading decimal separator don’t worry. You’re not alone. Recently I’ve came across a problem of different date formats on grid view for users. Base setting has been overridden by […]

LookupAccountName failed with error, systemuser entity

LookupAccountName failed with error, systemuser entity

Info: Recently I came across that error at SystemUser creation pipeline. Reason: Wrong domain has been specified and/or user doesn’t exists in ActiveDirectory. Solution: Ensure correct domain prefix is specified and user actually exists in AD and is enabled. CrmVersion: 2011 OnPremises StackTrace info: at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) at Microsoft.Crm.Extensibility.InprocessServiceProxy.CreateCore(Entity […]