If you plan to use webpart with Jquery u have to use Contribute permissions. If less privileged permissions are used, no information will be displayed.
I discovered that there is no need for whole Contribute permissions level. There is one permission responsible for this - Update Personal Web Parts - Update Web Parts to display personalized information.
So we can create new permission level (make a copy of Read level) and add this permission.
Wednesday, February 5, 2014
Monday, March 25, 2013
Query CRM 2011 data with JSON synchronously
After we installed CRM update rollup 12 (KB 2795627), we encountered very big problems with our customizations relating to SOAP queries that were across multiple entities. CRM rollup 12 (finally) introduces us with additional browser compatibility for Firefox, Chrome, and Safari.
After rollup our customizations that were using SOAP requests didn't work anymore on Chrome, Firefox and Internet Explorer 10. We discovered that SOAP requests uses ActiveXobject and this is not supported!!!
To rebuild our customizations we used synchronous JSON queries, that solved our problems and even made our crm customizations better and whole scripting technique lighter.
This excellent article Read records synchronously using JSON in CRM 2011 helped us to build our JSON queries like this:
Example function for retrieving current user full name
function getUserFullName() {
var userid = Xrm.Page.context.getUserId();
var retrieveRecordsReq = new XMLHttpRequest();
var ODataPath = "/xrmservices/2011/OrganizationData.svc/SystemUserSet?$select=FullName&$filter=SystemUserId eq guid'" + userid + "'";
retrieveRecordsReq.open('GET', ODataPath, false);
retrieveRecordsReq.setRequestHeader("Accept", "application/json");
retrieveRecordsReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
retrieveRecordsReq.send(null);
var records = JSON.parse(retrieveRecordsReq.responseText).d;
var FullName = records.results[0].FullName;
return FullName;
}
After rollup our customizations that were using SOAP requests didn't work anymore on Chrome, Firefox and Internet Explorer 10. We discovered that SOAP requests uses ActiveXobject and this is not supported!!!
To rebuild our customizations we used synchronous JSON queries, that solved our problems and even made our crm customizations better and whole scripting technique lighter.
This excellent article Read records synchronously using JSON in CRM 2011 helped us to build our JSON queries like this:
Example function for retrieving current user full name
function getUserFullName() {
var userid = Xrm.Page.context.getUserId();
var retrieveRecordsReq = new XMLHttpRequest();
var ODataPath = "/xrmservices/2011/OrganizationData.svc/SystemUserSet?$select=FullName&$filter=SystemUserId eq guid'" + userid + "'";
retrieveRecordsReq.open('GET', ODataPath, false);
retrieveRecordsReq.setRequestHeader("Accept", "application/json");
retrieveRecordsReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
retrieveRecordsReq.send(null);
var records = JSON.parse(retrieveRecordsReq.responseText).d;
var FullName = records.results[0].FullName;
return FullName;
}
Etiķetes:
CRM
Monday, December 3, 2012
An internal database error occurred in the Business Data Connectivity Shared service (BDC)
Firstly i want to say that i run across on this error not quite (as i thought) relating to BDC.. but:
My initial goal was simple - create some custom list in SP2010 with Lookup (information already on this site) fields. When i tried to do that i got following message:
So.. BDC service is related with creating Lookup type fields in SharePoint. Time ago we moved our SharePoint databases to new SQL server, but we didn't move our BDC db.. so i started to realize where is the problem. I have to create new BDC service application with new db in our new sql server + delete old BDC application (relationships), point my web application to new BDC service application.
I looked in SP Central Adminstration page for Service Applications (Application management -> Manage Service Applications).
1. Deleted old BDC application.
2. Created new BDC.
3. Point web application to new BDC (Application management -> Service Applications -> Service Application Associations)
4. IISRESET
But unfortuneatlly when i tried to create Lookup field i got new error saying:
Entity (External Content Type) cannot be found with Namespace = '', Name = 'New external content Type'
Solution:
Previously i had some (With old BDC application) External Lists with custom external content types in them, so when we are creating Lookup fields, SharePoitn is looking for those content types and they didn't exist any more, so i DELETED THOSE OLD EXTERNAL LISTS.
My initial goal was simple - create some custom list in SP2010 with Lookup (information already on this site) fields. When i tried to do that i got following message:
So.. BDC service is related with creating Lookup type fields in SharePoint. Time ago we moved our SharePoint databases to new SQL server, but we didn't move our BDC db.. so i started to realize where is the problem. I have to create new BDC service application with new db in our new sql server + delete old BDC application (relationships), point my web application to new BDC service application.
I looked in SP Central Adminstration page for Service Applications (Application management -> Manage Service Applications).
1. Deleted old BDC application.
2. Created new BDC.
3. Point web application to new BDC (Application management -> Service Applications -> Service Application Associations)
4. IISRESET
But unfortuneatlly when i tried to create Lookup field i got new error saying:
Entity (External Content Type) cannot be found with Namespace = '', Name = 'New external content Type'
Solution:
Previously i had some (With old BDC application) External Lists with custom external content types in them, so when we are creating Lookup fields, SharePoitn is looking for those content types and they didn't exist any more, so i DELETED THOSE OLD EXTERNAL LISTS.
Etiķetes:
SharePoint
Friday, October 12, 2012
This item is no longer available. It may have been deleted by another user
There are many articles about this SharePoint error message: "This item is no longer available. It may have been deleted by another user"
Mike Smith's Tech Training Notes and
http://girishm.blog.com/2010/07/11/this-item-is-no-longer-available-it-may-have-been-deleted-by-another-user-click-ok-to-refresh-the-page/
These solutions didn't work for me!
IN MY CASE I SIMPLY DELETE INTERNET TEMPORARY FILES & COOKIES!!!
Mike Smith's Tech Training Notes and
http://girishm.blog.com/2010/07/11/this-item-is-no-longer-available-it-may-have-been-deleted-by-another-user-click-ok-to-refresh-the-page/
These solutions didn't work for me!
IN MY CASE I SIMPLY DELETE INTERNET TEMPORARY FILES & COOKIES!!!
Etiķetes:
SharePoint
Thursday, August 30, 2012
SCSM Creating Manual Activity for Incident in C#
Some time ago I had to develope application that could connect two systems: Microsoft Dynamics CRM & SCSM (Microsoft System Center Service Manager). The main purpose of this application is to synchronize data between two applications.
In this article i will show you only some little part (but maybe one of the toughest for me...) of my application code.
I will continue to post some other usefull parts from this project.
The code consists of 3 main steps:
1. Create relationship between incident & manual activity
2. Create manual activity
3. Assign created activity to incident
There is good post about creating incident in SCSM which really helped me out: http://blogs.technet.com/b/servicemanager/archive/2009/08/09/the-system-center-platform-in-service-manager-part-3-the-data-access-service-try-it.aspx
//Create relationship between incident & manual acticvity
ManagementPackRelationship workItemContainsActivityRelationship =
mg.EntityTypes.GetRelationshipClass(new Guid("2DA498BE-0485-B2B2-D520-6EBD1698E61B"));
CreatableEnterpriseManagementRelationshipObject AssignedToIncident =
new CreatableEnterpriseManagementRelationshipObject(mg, workItemContainsActivityRelationship);
//Create Manual Activity
CreatableEnterpriseManagementObject activityItemObject =
new CreatableEnterpriseManagementObject(mg, classManualActivity);
Guid newActivityGuid = Guid.NewGuid();
activityItemObject[classManualActivity, "Id"].Value = newActivityGuid.ToString();
activityItemObject[classManualActivity, "Title"].Value = "<Title>";
activityItemObject[classManualActivity, "Description"].Value = "<Description>";
EnterpriseManagementObjectGenericCriteria genericCr =
new EnterpriseManagementObjectGenericCriteria("Id == '" + <SCSM Incident Id>.ToString() + "'");
IObjectReader<EnterpriseManagementObject> reader = mg.EntityObjects.GetObjectReader<EnterpriseManagementObject>(genericCr, ObjectQueryOptions.Default);
if (reader != null && reader.Count > 0) {
foreach (EnterpriseManagementObject obj in reader) {
AssignedToIncident.SetSource(obj);
AssignedToIncident.SetTarget(activityItemObject);
IncrementalDiscoveryData dd = new IncrementalDiscoveryData();
dd.Add(activityItemObject);
dd.Add(AssignedToIncident);
dd.Overwrite(mg);
//Assign Manual Activity to Incident
AssignedToIncident.Commit();
}
}
Thursday, August 23, 2012
How to get all SharePoint Users with web services in c#
SPservice.UserGroup usergroup = new SPservice.UserGroup();
usergroup.Credentials = System.Net.CredentialCache.DefaultCredentials;
XmlNode allusers = usergroup.GetAllUserCollectionFromWeb();
foreach (XmlNode child in allusers.ChildNodes) {
foreach (XmlNode item in child) {
foreach (XmlAttribute atr in item.Attributes) {
if (atr.Name.ToString() == "LoginName") {
MessageBox.Show(atr.OuterXml);
}
}
}
}
SPservice - name of web reference in your visual studio project with URL:
http://<your server name>
Etiķetes:
SharePoint
Friday, July 27, 2012
CRM 4 how to retrieve custom attribute value in C#
DynamicEntity someEntity;
TargetRetrieveDynamic retrieveTarget = new TargetRetrieveDynamic();
retrieveTarget.EntityId = <id of entity>;
retrieveTarget.EntityName = EntityName.<entity name>.ToString();
RetrieveRequest retrieveRequest = new RetrieveRequest();
retrieveRequest.ColumnSet = new ColumnSet(new string[] { "your_custom_attribute" });
retrieveRequest.ReturnDynamicEntities = true;
retrieveRequest.Target = retrieveTarget;
RetrieveResponse retrieveResponse = (RetrieveResponse)service.Execute(retrieveRequest);
someEntity = retrieveResponse.BusinessEntity as DynamicEntity;
String result = (String)someEntity["your_custom_attribute"];
String value = result.Value.ToString();
Etiķetes:
CRM
CRM 4 Workflow error message details
In CRM 4 to get more info from workflow error than "An error has occurred" run this command against CRM database:
select Message from AsyncOperationBase
order by CreatedOn desc
select Message from AsyncOperationBase
order by CreatedOn desc
Etiķetes:
CRM
Thursday, January 5, 2012
CRM 2011 Create a new Case (incident) using C#
using System;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Discovery;
using System.Runtime.Serialization;
namespace CreateIncident
{
class Program
{
static void Main (string[] args)
{
try
{
Uri organizationUri = new Uri("http://crmservername:port/orgname/XRMServices/2011/Organization.svc");
}
catch (Exception e)
{
Console.Write(e.ToString());
}
}
}
}
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Discovery;
using System.Runtime.Serialization;
namespace CreateIncident
{
class Program
{
static void Main (string[] args)
{
try
{
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = new System.Net.NetworkCredential
credentials.Windows.ClientCredential = new System.Net.NetworkCredential
("username", "passw", "domain");
Uri organizationUri = new Uri("http://crmservername:port/orgname/XRMServices/2011/Organization.svc");
Uri homeRealmUri = null;
OrganizationServiceProxy orgService = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);
IOrganizationService _service = (IOrganizationService)orgService;
Entity incident = new Entity();
incident.LogicalName = "incident";
incident["title"] = "Case subject..";
// Set customerid with some existing contact guid
Guid customerid = new Guid("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}");
// Set customerid as contact to field "customerid"
EntityReference CustomerId = new EntityReference("contact", customerid);
incident["customerid"] = CustomerId;
// Set contactid with some existing contact guid
Guid contactid = new Guid("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}");
// Set contactid as contact to field "casecontactid"
EntityReference primaryContactId = new EntityReference("contact", contactid);
incident["casecontactid"] = primaryContactId;
_service.Create(incident);
}
catch (Exception e)
{
Console.Write(e.ToString());
}
}
}
}
Etiķetes:
CRM
Monday, January 2, 2012
CRM 2011 Custom Email with Pdf report attachment
After migration from CRM 4 to CRM 2011 my plugin written for custom email with PDF report won't work anymore so i rebuild my previous solution from CRM 4 with necessary changes for new CRM 2011:
using System;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Crm.Sdk.Messages;
using SendReport.ReportService;
using Microsoft.Crm.Sdk;
using Microsoft.Xrm.Sdk.Query;
namespace SendReport
{
public class SendReport : CodeActivity
{
protected override void Execute(CodeActivityContext executionContext)
{
try
{
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
Guid incidentId = context.PrimaryEntityId;
byte[] result = null;
ReportService.ReportExecutionService rs = new ReportExecutionService();
rs.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
rs.Url = "http://crmserver/ReportServer/ReportExecution2005.asmx";
string reportPath = "/Reports/reportname";
string format = "PDF";
string historyID = null;
string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].Name = "incidentid";
parameters[0].Value = incidentId.ToString();
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
ExecutionInfo execInfo = new ExecutionInfo();
ExecutionHeader execHeader = new ExecutionHeader();
rs.ExecutionHeaderValue = execHeader;
execInfo = rs.LoadReport(reportPath, historyID);
rs.SetExecutionParameters(parameters, "en-us");
String SessionId = rs.ExecutionHeaderValue.ExecutionID;
try
{
result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out
streamIDs);
}
catch (Exception err)
{
throw new Exception(err.Message.ToString());
}
Entity email = new Entity();
email.LogicalName = "email";
EntityReference regardingObject = new EntityReference("incident", incidentId);
email.Attributes.Add("regardingobjectid", regardingObject);
Guid senderUserId = Sender.Get<EntityReference>(executionContext).Id;
Guid recieverUserId = Recipient.Get<EntityReference>(executionContext).Id;
Guid recieverCCUserId = RecipientCC.Get<EntityReference>(executionContext).Id;
EntityReference from = new EntityReference("systemuser", senderUserId);
EntityReference to = new EntityReference("contact", recieverUserId);
EntityReference cc = new EntityReference("contact", recieverCCUserId);
Entity fromParty = new Entity("activityparty");
fromParty.Attributes.Add("partyid", from);
Entity toParty = new Entity("activityparty");
toParty.Attributes.Add("partyid", to);
Entity ccParty = new Entity("activityparty");
ccParty.Attributes.Add("partyid", cc);
EntityCollection collFromParty = new EntityCollection();
collFromParty.EntityName = "systemuser";
collFromParty.Entities.Add(fromParty);
EntityCollection collToParty = new EntityCollection();
collToParty.EntityName = "systemuser";
collToParty.Entities.Add(toParty);
EntityCollection collccParty = new EntityCollection();
collccParty.EntityName = "systemuser";
collccParty.Entities.Add(ccParty);
var entity = service.Retrieve("incident", incidentId, new ColumnSet(new[] { "ticketnumber", "customerid", "title"}));
var ticket = entity.GetAttributeValue<string>("ticketnumber");
var customer = entity.GetAttributeValue<EntityReference>("customerid");
var customername = customer.Name;
var title = entity.GetAttributeValue<string>("title");
email.Attributes.Add("from", collFromParty);
email.Attributes.Add("to", collToParty);
email.Attributes.Add("cc", collccParty);
email.Attributes.Add("subject", "Here goes subject message.. : " + ticket);
email.Attributes.Add("description", "Here goes description text..");
Guid emailID = service.Create(email);
// Attaching Pdf report
CrmNumber crmNextActorID = new CrmNumber();
RetrieveEntityRequest request = new RetrieveEntityRequest();
request.LogicalName = "email";
RetrieveEntityResponse response = (RetrieveEntityResponse)service.Execute(request);
int objecttypecode = response.EntityMetadata.ObjectTypeCode.Value;
Entity attachment = new Entity("activitymimeattachment");
attachment.Attributes.Add("subject", "Report");
attachment.Attributes.Add("filename", "Report.pdf");
attachment.Attributes.Add("body", Convert.ToBase64String(result));
attachment.Attributes.Add("filesize", new CrmNumber(Convert.ToInt32(result.Length.ToString())));
attachment.Attributes.Add("mimetype", "text/plain");
attachment.Attributes.Add("attachmentnumber", crmNextActorID.Value);
attachment.Attributes.Add("objectid", new EntityReference("email", new Guid(email.Id.ToString())));
attachment.Attributes.Add("objecttypecode", objecttypecode);
service.Create(attachment);
SendEmailRequest reqSendEmail = new SendEmailRequest();
reqSendEmail.EmailId = emailID;
reqSendEmail.TrackingToken = "";
reqSendEmail.IssueSend = true;
SendEmailResponse res = (SendEmailResponse)service.Execute(reqSendEmail);
}
catch (Exception err)
{
throw new Exception(err.ToString());
}
}
[RequiredArgument]
[Input("Sender input")]
[ReferenceTarget("systemuser")]
public InArgument<EntityReference> Sender { get; set; }
[RequiredArgument]
[Input("Recipient input")]
[ReferenceTarget("contact")]
public InArgument<EntityReference> Recipient { get; set; }
[RequiredArgument]
[Input("RecipientCC input")]
[ReferenceTarget("contact")]
public InArgument<EntityReference> RecipientCC { get; set; }
}
}
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Crm.Sdk.Messages;
using SendReport.ReportService;
using Microsoft.Crm.Sdk;
using Microsoft.Xrm.Sdk.Query;
namespace SendReport
{
public class SendReport : CodeActivity
{
protected override void Execute(CodeActivityContext executionContext)
{
try
{
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
Guid incidentId = context.PrimaryEntityId;
byte[] result = null;
ReportService.ReportExecutionService rs = new ReportExecutionService();
rs.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
rs.Url = "http://crmserver/ReportServer/ReportExecution2005.asmx";
string reportPath = "/Reports/reportname";
string format = "PDF";
string historyID = null;
string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].Name = "incidentid";
parameters[0].Value = incidentId.ToString();
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
ExecutionInfo execInfo = new ExecutionInfo();
ExecutionHeader execHeader = new ExecutionHeader();
rs.ExecutionHeaderValue = execHeader;
execInfo = rs.LoadReport(reportPath, historyID);
rs.SetExecutionParameters(parameters, "en-us");
String SessionId = rs.ExecutionHeaderValue.ExecutionID;
try
{
result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out
streamIDs);
}
catch (Exception err)
{
throw new Exception(err.Message.ToString());
}
Entity email = new Entity();
email.LogicalName = "email";
EntityReference regardingObject = new EntityReference("incident", incidentId);
email.Attributes.Add("regardingobjectid", regardingObject);
Guid senderUserId = Sender.Get<EntityReference>(executionContext).Id;
Guid recieverUserId = Recipient.Get<EntityReference>(executionContext).Id;
Guid recieverCCUserId = RecipientCC.Get<EntityReference>(executionContext).Id;
EntityReference from = new EntityReference("systemuser", senderUserId);
EntityReference to = new EntityReference("contact", recieverUserId);
EntityReference cc = new EntityReference("contact", recieverCCUserId);
Entity fromParty = new Entity("activityparty");
fromParty.Attributes.Add("partyid", from);
Entity toParty = new Entity("activityparty");
toParty.Attributes.Add("partyid", to);
Entity ccParty = new Entity("activityparty");
ccParty.Attributes.Add("partyid", cc);
EntityCollection collFromParty = new EntityCollection();
collFromParty.EntityName = "systemuser";
collFromParty.Entities.Add(fromParty);
EntityCollection collToParty = new EntityCollection();
collToParty.EntityName = "systemuser";
collToParty.Entities.Add(toParty);
EntityCollection collccParty = new EntityCollection();
collccParty.EntityName = "systemuser";
collccParty.Entities.Add(ccParty);
var entity = service.Retrieve("incident", incidentId, new ColumnSet(new[] { "ticketnumber", "customerid", "title"}));
var ticket = entity.GetAttributeValue<string>("ticketnumber");
var customer = entity.GetAttributeValue<EntityReference>("customerid");
var customername = customer.Name;
var title = entity.GetAttributeValue<string>("title");
email.Attributes.Add("from", collFromParty);
email.Attributes.Add("to", collToParty);
email.Attributes.Add("cc", collccParty);
email.Attributes.Add("subject", "Here goes subject message.. : " + ticket);
email.Attributes.Add("description", "Here goes description text..");
Guid emailID = service.Create(email);
// Attaching Pdf report
CrmNumber crmNextActorID = new CrmNumber();
RetrieveEntityRequest request = new RetrieveEntityRequest();
request.LogicalName = "email";
RetrieveEntityResponse response = (RetrieveEntityResponse)service.Execute(request);
int objecttypecode = response.EntityMetadata.ObjectTypeCode.Value;
Entity attachment = new Entity("activitymimeattachment");
attachment.Attributes.Add("subject", "Report");
attachment.Attributes.Add("filename", "Report.pdf");
attachment.Attributes.Add("body", Convert.ToBase64String(result));
attachment.Attributes.Add("filesize", new CrmNumber(Convert.ToInt32(result.Length.ToString())));
attachment.Attributes.Add("mimetype", "text/plain");
attachment.Attributes.Add("attachmentnumber", crmNextActorID.Value);
attachment.Attributes.Add("objectid", new EntityReference("email", new Guid(email.Id.ToString())));
attachment.Attributes.Add("objecttypecode", objecttypecode);
service.Create(attachment);
SendEmailRequest reqSendEmail = new SendEmailRequest();
reqSendEmail.EmailId = emailID;
reqSendEmail.TrackingToken = "";
reqSendEmail.IssueSend = true;
SendEmailResponse res = (SendEmailResponse)service.Execute(reqSendEmail);
}
catch (Exception err)
{
throw new Exception(err.ToString());
}
}
[RequiredArgument]
[Input("Sender input")]
[ReferenceTarget("systemuser")]
public InArgument<EntityReference> Sender { get; set; }
[RequiredArgument]
[Input("Recipient input")]
[ReferenceTarget("contact")]
public InArgument<EntityReference> Recipient { get; set; }
[RequiredArgument]
[Input("RecipientCC input")]
[ReferenceTarget("contact")]
public InArgument<EntityReference> RecipientCC { get; set; }
}
}
Etiķetes:
CRM
Wednesday, October 19, 2011
CRM 4.0 migration to CRM 2011
Backup CRM 4.0 SQL Server database
1. Open SQL Studio Manager
2. Connect to CRM 4.0 database
3. Expand Databases
4. Right-click on xxxxxx_MSCRM database, Tasks -> Back Up
5. Back Up to Disk (dbname.bak)
Restore CRM 4.0 database in CRM 2011 SQL Server
1. Open SQL Studio Manager
2. Connect to CRM 2011 database
3. Right-click on Databases, Restore Database
4. To Database - type in new crm database name, From Disk - select backup you created (dbname.bak) from CRM 4.0 SQL Server
Import new database with CRM 2011 Deployment Manager
1. Run CRM 2011 Deployment Manager (Start->All Programs->Microsoft Dynamics CRM->Deployment Manager)
2. Organizations -> Import Organization
3. Select database you restored in CRM 2011 SQL Server
4. Type in Display name and Unique Database Name (of your choice)
5. Type in CRM 2011 Report Server URL
6. Select "Automatically Map Users" (if you are in the same domain)
7. If some user doesn't exist in new CRM 2011 you can create them in Active Directory and then map them or just ignore this and go further.
8. System checks all prerequisites for Import.
9. *.If there are no errors you can click Import (Import can take up to some hours, depending on your db size and customizations etc).
*. If you see warning "Fragmented indexes were detected in the Microsoft Dynamics CRM database", you can ignore this message and go further but i would suggest you to do following as it greatly can impact the overall import process time: This error message says that there are fragmented indexes. To rebuild these indexes you can use this link:
http://crrm.ru/articles/2011/05/index-optimization-before-in-place-upgrade-to-crm-2011 (In Russian)
1. Open SQL Studio Manager
2. Connect to CRM 4.0 database
3. Expand Databases
4. Right-click on xxxxxx_MSCRM database, Tasks -> Back Up
5. Back Up to Disk (dbname.bak)
Restore CRM 4.0 database in CRM 2011 SQL Server
1. Open SQL Studio Manager
2. Connect to CRM 2011 database
3. Right-click on Databases, Restore Database
4. To Database - type in new crm database name, From Disk - select backup you created (dbname.bak) from CRM 4.0 SQL Server
Import new database with CRM 2011 Deployment Manager
1. Run CRM 2011 Deployment Manager (Start->All Programs->Microsoft Dynamics CRM->Deployment Manager)
2. Organizations -> Import Organization
3. Select database you restored in CRM 2011 SQL Server
4. Type in Display name and Unique Database Name (of your choice)
5. Type in CRM 2011 Report Server URL
6. Select "Automatically Map Users" (if you are in the same domain)
7. If some user doesn't exist in new CRM 2011 you can create them in Active Directory and then map them or just ignore this and go further.
8. System checks all prerequisites for Import.
9. *.If there are no errors you can click Import (Import can take up to some hours, depending on your db size and customizations etc).
*. If you see warning "Fragmented indexes were detected in the Microsoft Dynamics CRM database", you can ignore this message and go further but i would suggest you to do following as it greatly can impact the overall import process time: This error message says that there are fragmented indexes. To rebuild these indexes you can use this link:
http://crrm.ru/articles/2011/05/index-optimization-before-in-place-upgrade-to-crm-2011 (In Russian)
1. Download all 3 files from this link above (IndexOptimize.sql, CommandExecute.sql, DatabaseSelect.sql)
2. Open them via SQL Studio Manager and execute them: At very begining of each script add these two lines to select your CRM 4.0 database for creating these stored procedures -
USE <xxxxx_MSCRM>
GO
2. Open them via SQL Studio Manager and execute them: At very begining of each script add these two lines to select your CRM 4.0 database for creating these stored procedures -
USE <xxxxx_MSCRM>
GO
3. And finally run this script to rebuild indexes:
EXECUTE dbo.IndexOptimize @Databases = 'orgname_MSCRM',
@FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationMedium = 'INDEX_REORGANIZE',
@FragmentationLow = NULL
4. And then proceed with Import.
Etiķetes:
CRM
Monday, July 25, 2011
Sharepoint 2010 Server install Step By Step
In my previous post Sharepoint 2010 Foundation Install Step By Step we went through the steps to install SharePoint 2010 Foundation, so this time we will go through SharePoint Server 2010 installation process.
there is practically no difference between SPF 2010 & SPS2010 installation, except of some new error messages :)
there is practically no difference between SPF 2010 & SPS2010 installation, except of some new error messages :)
So here we go
Etiķetes:
SharePoint
Thursday, July 7, 2011
CRM email with pdf report attachment
1.step: In Visual Studio creating new WORKFLOW ACTIVITY LIBRARY
2.step: Add references Microsoft.Crm.Sdk, Microsoft.Crm.SdkTypeProxy;
3.step: Add web reference
http://<reportservername>/ReportServer/ReportExecution2005.asmx4.step: Debug this code5.step: Run Plugin Registration Tool and register new assembly (that will be dll created from this source in path where this project will be created in bin folder)6.step: Create new Workflow in crm with this custom workflow activity as new stepAnd here goes full code:
Etiķetes:
CRM
Wednesday, May 25, 2011
CRM in FireFox
If your preferred browser is not IE.. :) then there is great solution to work with Microsoft Dynamics CRM in Mozilla FireFox - "IE TAB" Add-on.
To use this add-on:
1. download add-on
2. restart FireFox
3. Tools -> IE Tab 2 options
4. Add your CRM site url to "Sites Filter" section
That's it, CRM in FireFox
Etiķetes:
CRM
Wednesday, May 18, 2011
CRM FetchXml with Javascript
FetchXML method using javascript in CRM, allows me to use linked entities, so I can query attributes from different tables and linke them together with some primary attribute.
Here's example:
// Prepare variables
var fetchMapping = "logical";
var entityName = "entitiyname"; //first attribute to fetch from this entity [CHANGE THIS]
var FirstColumn = "attributename1"; //first attribute to fetch from this entity [CHANGE THIS]
var SecondColumn = "attributename2"; //second attribute to fetch from this entity [CHANGE THIS]
var ThirdColumn = "attributename3"; //third attribute to fetch from this entity [CHANGE THIS]
var fetchMapping = "logical";
var entityName = "entitiyname"; //first attribute to fetch from this entity [CHANGE THIS]
var FirstColumn = "attributename1"; //first attribute to fetch from this entity [CHANGE THIS]
var SecondColumn = "attributename2"; //second attribute to fetch from this entity [CHANGE THIS]
var ThirdColumn = "attributename3"; //third attribute to fetch from this entity [CHANGE THIS]
Etiķetes:
CRM
Tuesday, May 17, 2011
Sharepoint Query with SPAPI
1. To use SPAPI query download it from HERE!!!.
2. On SharePoint server under "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS" create folder "SPAPI".
3. Place extracted js files from download to this folder.
4. Put your query within these code lines:
<script type="text/javascript" src="/_layouts/SPAPI/SPAPI_Core.js"></script>
<script type="text/javascript" src="/_layouts/SPAPI/SPAPI_Lists.js"></script>
<script type="text/javascript">
<your spapi query>
</script>
//SPAPI query example:
2. On SharePoint server under "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS" create folder "SPAPI".
3. Place extracted js files from download to this folder.
4. Put your query within these code lines:
<script type="text/javascript" src="/_layouts/SPAPI/SPAPI_Core.js"></script>
<script type="text/javascript" src="/_layouts/SPAPI/SPAPI_Lists.js"></script>
<script type="text/javascript">
<your spapi query>
</script>
//SPAPI query example:
Etiķetes:
SharePoint
Monday, April 11, 2011
SharePoint Workflow does not start automatically (kb947284)
I was able to start my workflow automatically which I created through SharePoint Designer.
Firstly I checked out instructions from this article kb947284. In my case regarding to kb947284 I was logged in with "System Account". So I took some other user from sharepoint member group and logged back in, but with no luck...
After hours of endless searching i came across to something like this: "If I browse my sharepoint web page with IP address instead of hostname automatic workflows wouldn't start!!!"
Etiķetes:
SharePoint
Friday, April 1, 2011
Sharepoint 2010 Foundation install Step By Step
My goal was to install Sharepoint Foundation 2010 (SPF2010) so that web application is on one server and the database is on seperate server.
Etiķetes:
SharePoint
Tuesday, March 29, 2011
Latest earthquakes in the World
Very usefull online information tool to get info for latest earthquakes and volcanos in the world
Etiķetes:
GPS
Monday, March 28, 2011
How long does it take to drive through Riga city ?
I must say that this is not a story about THIS. My approach was more realistic and much safer :)I took my car to drive through city Riga from one city border to another simply to check how much time do i need to get through this city within legal limits.
Etiķetes:
GPS
Subscribe to:
Comments (Atom)

