Home » Archives for 2016
In this post, i have no explanation, just see the image and you will understood
Step 1.
Step 2.
Step 3.
Step 4.
Step 5.
Step 6.
Step 7.
Step 8.
Step 9.
Step 10.
Finish
the table name should be the nam of you excel sheet name, just rename it as you want, thanks for visiting :)
Step 1.
Step 2.
Step 3.
Step 4.
Step 6.
Step 7.
Step 8.
Step 9.
Step 10.
Finish
the table name should be the nam of you excel sheet name, just rename it as you want, thanks for visiting :)
In this post, i have no explanation, just see the image and you will understood
Step 1.
Step 2.
Step 3.
Step 4.
Step 5.
Step 6.
Step 7.
Step 8.
Step 9.
Step 10.
Finish
the table name should be the nam of you excel sheet name, just rename it as you want, thanks for visiting :)
Step 1.
Step 2.
Step 3.
Step 4.
Step 6.
Step 7.
Step 8.
Step 9.
Step 10.
Finish
the table name should be the nam of you excel sheet name, just rename it as you want, thanks for visiting :)
Firstly, What is Cursor?
wikipedia said:
In computer science, a database cursor is a control structure that enables traversal over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and removal of database records. The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator.
Cursors are used by database programmers to process individual rows returned by database system queries. Cursors enable manipulation of whole result sets at once. In this scenario, a cursor enables the rows in a result set to be processed sequentially.
In SQL procedures, a cursor makes it possible to define a result set (a set of data rows) and perform complex logic on a row by row basis. By using the same mechanics, a SQL procedure can also define a result set and return it directly to the caller of the SQL procedure or to a client application.
A cursor can be viewed as a pointer to one row in a set of rows. The cursor can only reference one row at a time, but can move to other rows of the result set as needed. source:https://en.wikipedia.org/wiki/Cursor_(databases)
and the second is
this is the sample code how to create cursor in SQL Server
and the result is :
thanks for visiting :)
wikipedia said:
In computer science, a database cursor is a control structure that enables traversal over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and removal of database records. The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator.
Cursors are used by database programmers to process individual rows returned by database system queries. Cursors enable manipulation of whole result sets at once. In this scenario, a cursor enables the rows in a result set to be processed sequentially.
In SQL procedures, a cursor makes it possible to define a result set (a set of data rows) and perform complex logic on a row by row basis. By using the same mechanics, a SQL procedure can also define a result set and return it directly to the caller of the SQL procedure or to a client application.
A cursor can be viewed as a pointer to one row in a set of rows. The cursor can only reference one row at a time, but can move to other rows of the result set as needed. source:https://en.wikipedia.org/wiki/Cursor_(databases)
and the second is
this is the sample code how to create cursor in SQL Server
DECLARE @customerid varchar(100) DECLARE CUSTOMER_CURSOR CURSOR FOR SELECT CustomerID from Customers WHERE CustomerID is NOT NULL OPEN CUSTOMER_CURSOR FETCH NEXT FROM CUSTOMER_CURSOR INTO @customerid WHILE @@FETCH_STATUS=0 BEGIN --yourcode here PRINT @customerid FETCH NEXT FROM CUSTOMER_CURSOR INTO @customerid END CLOSE CUSTOMER_CURSOR DEALLOCATE CUSTOMER_CURSOR
and the result is :
A Simple Cursor In SQL Server 2008 R2 |
How to disable view picker in filtered view CRM 2011 Javascript |
Step 1
create your own filter view
function filter_view() { var viewid = "{a76b2c46-c28e-4e5e-9ddf-951b71202c77}";//random var entityname = "new_entityname"; var displayname = "Filter view"; var fetchxml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" + "<entity name='new_entityname'>" + "<attribute name='new_name' />" + "<filter type='and'>" + "<condition attribute='statecode' operator='eq' value='0' />" + "</filter>" + "</entity>" + "</fetch>"; var layoutxml = "<grid name='resultset' " + "object='1' " + "jump='name' " + "select='1' " + "icon='0' " + "preview='0'>" + "<row name='result' " + "id='new_entitynameid'>" + "<cell name='new_name' " + "width='200' />" + "</row>" + "</grid>"; Xrm.Page.getControl("new_fieldname").addCustomView(viewid, entityname, displayname, fetchxml, layoutxml, true);
Step 2
just add a little bit code to disable view picker in the and of function
document.getElementById("xrm_segmentlevel2").setAttribute("disableViewPicker", "1");
Step 3
Done, and finish
thanks for visiting and enjong coding :)
Unable to get property 'value' of undifined or null reference |
these are a simple step to solve it:
Step 1
this is my full function
function autofill() { var formtype =Xrm.Page.ui.getFormType(); if (formtype==1){ var objlookup = Xrm.Page.getAttribute("new_contact").getValue(); if (objlookup!=null) { var fetchXml= "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+ "<entity name='contact'>"+ "<attribute name='fullname' />"+ "<attribute name='telephone1' />"+ "<attribute name='contactid' />"+ "<attribute name='emailaddress1' />"+ "<attribute name='mobilephone' />"+ "<order attribute='fullname' descending='false' />"+ "<filter type='and'>"+ "<condition attribute='statecode' operator='eq' value='0' />"+ "</filter>"+ "</entity>"+ "</fetch>"; var _contact = XrmServiceToolkit.Soap.Fetch(fetchXml); if (_contact.length > 0){ var fullname=""; var mobilephone=""; var email=""; if (_contact[0].attributes.fullname != undefined) fullname = _contact[0].attributes.fullname.value; if (_contact[0].attributes.mobilephone != undefined) mobilephone = _contact[0].attributes.mobilephone.value; } } } }
to solve the problem just add a little bit code below
if (_contact[0].attributes.fullname != undefined) { //you code here }
Thanks for visiting and happy coding :)
You can retrieve data entity crm by sdk CRM using c# code. beside that, also you can retrieve entity in client side by javascript. these are the steps !
Step 1
Create Javascript Functon as below:
Step 2
Load Javascript file and call the function
Step 3
Result should be :
Thanks for visiting
Step 1
Create Javascript Functon as below:
function personalautofill() { var formtype =Xrm.Page.ui.getFormType(); if (formtype==1){ var objlookup = Xrm.Page.getAttribute("new_personal").getValue(); if (objlookup!=null) { var personalid = objlookup[0].id; var personalname = objlookup[0].name; var fetchXmlPersonal = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+ "<entity name='contact'>"+ "<attribute name='fullname' />"+ "<attribute name='telephone1' />"+ "<attribute name='contactid' />"+ "<attribute name='emailaddress1' />"+ "<attribute name='mobilephone' />"+ "<order attribute='fullname' descending='false' />"+ "<filter type='and'>"+ "<condition attribute='contactid' operator='eq' value='"+personalid+"' />"+ "<condition attribute='statecode' operator='eq' value='0' />"+ "</filter>"+ "</entity>"+ "</fetch>"; var _personal = XrmServiceToolkit.Soap.Fetch(fetchXmlPersonal); if (_personal.length > 0){ alert(JSON.stringify(_personal)); } } } }
Step 2
Load Javascript file and call the function
How to get lookup value CRM 2015 using javascript - load js |
Step 3
Result should be :
How to get lookup value CRM 2015 using javascript - result |
Step 1
Download Microsoft Ribbon editor for CRM 2013/2015/2016 here
Download page Ribbon editor CRM 2015 |
go to your CRM page Setting
Step by Step How To Install Rebbon CRM 2015 - CRM Setting |
Step 3
Solution
Step by Step How To Install Rebbon CRM 2015 - Solution |
Step 4
Import Ribbon Here
Step by Step How To Install Rebbon CRM 2015 - Import solution |
Step by Step How To Install Rebbon CRM 2015 - Import zip |
Step by Step How To Install Rebbon CRM 2015 - Import zip |
Step by Step How To Install Rebbon CRM 2015 - Import progress |
Step by Step How To Install Rebbon CRM 2015 - Import success |
Now you can see "RIBBON WORKBENCH" on your left side
|
CRUD Dynamic CRM 2011 |
Config:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="CRMUrlOrg" value="http://192.168.21.28:5555/yourorganization/XRMServices/2011/Organization.svc" /> <add key="CRMOrganization" value="yourorganization" /> <add key="CRMDomain" value="yourdomain" /> <add key="CRMUsername" value="yourusername" /> <add key="CRMPassword" value="yourpassword" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> </configuration>
1. Create Operation
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Query; using System.Configuration; using System.ServiceModel.Description; namespace DemoCRM { class Program { static void Main(string[] args) { //create service crm Uri urlcrm = new Uri(ConfigurationManager.AppSettings["CRMUrlOrg"]); string username = ConfigurationManager.AppSettings["CRMUsername"]; string password = ConfigurationManager.AppSettings["CRMPassword"]; ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential.UserName = username; credentials.Windows.ClientCredential.Password = password; OrganizationServiceProxy serviceproxy = new OrganizationServiceProxy(urlcrm, null, credentials, null); IOrganizationService service; service = (IOrganizationService)serviceproxy; //First tutorial CRUD Crm 2011 // 1. Create // insert into entity contact Entity _contact = new Entity("contact"); _contact.Attributes["firstname"] = "Jhon"; _contact.Attributes["lastname"] = "Corner"; _contact.Attributes["emailaddress1"] = "jhon@mial.com"; Guid contactID = service.Create(_contact); Console.WriteLine("INSERT CONTACT SUCCESS WITH THE GUID : " + contactID); Console.ReadKey(); //finish //lets run the program } } }
2. Read Operation
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Query; using System.Configuration; using System.ServiceModel.Description; namespace DemoCRM { class Program { static void Main(string[] args) { //create service crm Uri urlcrm = new Uri(ConfigurationManager.AppSettings["CRMUrlOrg"]); string username = ConfigurationManager.AppSettings["CRMUsername"]; string password = ConfigurationManager.AppSettings["CRMPassword"]; ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential.UserName = username; credentials.Windows.ClientCredential.Password = password; OrganizationServiceProxy serviceproxy = new OrganizationServiceProxy(urlcrm, null, credentials, null); IOrganizationService service; service = (IOrganizationService)serviceproxy; // read from entity contact QueryByAttribute q_readcontact = new QueryByAttribute("contact"); q_readcontact.ColumnSet = new ColumnSet(new string[] { "firstname", "lastname", "emailaddress1" }); q_readcontact.Attributes.Add("firstname"); q_readcontact.Values.Add("jhon"); //similar to //select firstname, lastname, emailaddress1 from contact where emailaddress1='jhon@mial.com' EntityCollection read_contacts = service.RetrieveMultiple(q_readcontact); // it return collection of entity // so, we use looping entity if (read_contacts.Entities.Count > 0) { foreach (Entity _contact in read_contacts.Entities) { string fname = _contact.Attributes["firstname"].ToString(); string lname = _contact.Attributes["lastname"].ToString(); string email = _contact.Attributes["emailaddress1"].ToString(); Console.WriteLine("read from entity contact :"); Console.WriteLine("first name : " + fname); Console.WriteLine("last name : " + lname); Console.WriteLine("email : " + email); Console.WriteLine("-------------------------------------------"); Console.WriteLine("press enter to continue"); Console.ReadKey(); //lets run the program } } } } }
3.Update Operation
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Query; using System.Configuration; using System.ServiceModel.Description; namespace DemoCRM { class Program { static void Main(string[] args) { //create service crm Uri urlcrm = new Uri(ConfigurationManager.AppSettings["CRMUrlOrg"]); string username = ConfigurationManager.AppSettings["CRMUsername"]; string password = ConfigurationManager.AppSettings["CRMPassword"]; ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential.UserName = username; credentials.Windows.ClientCredential.Password = password; OrganizationServiceProxy serviceproxy = new OrganizationServiceProxy(urlcrm, null, credentials, null); IOrganizationService service; service = (IOrganizationService)serviceproxy; //update entity crm //first, define which entity to update //update contact with email address='jhon@mial.com'; QueryByAttribute q_updatecontact = new QueryByAttribute("contact"); q_updatecontact.ColumnSet = new ColumnSet(new string[] { "firstname", "lastname", "emailaddress1" }); q_updatecontact.Attributes.Add("emailaddress1"); q_updatecontact.Values.Add("jhon@mial.com"); EntityCollection _updatecontacts = service.RetrieveMultiple(q_updatecontact); if (_updatecontacts.Entities.Count > 0) { foreach (Entity _updatecontact in _updatecontacts.Entities) { _updatecontact.Attributes["firstname"] = "Indiana"; _updatecontact.Attributes["lastname"] = "Jhones"; service.Update(_updatecontact); Console.WriteLine("Update contact success!"); Console.ReadKey(); //it similar to UPDATE contact SET firstname='Indiana', lastname='Jhones' WHERE emailaddress1='jhon@mial.com' //lets run the program } } } } }
4. Delete Operation
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Query; using System.Configuration; using System.ServiceModel.Description; namespace DemoCRM { class Program { static void Main(string[] args) { //create service crm Uri urlcrm = new Uri(ConfigurationManager.AppSettings["CRMUrlOrg"]); string username = ConfigurationManager.AppSettings["CRMUsername"]; string password = ConfigurationManager.AppSettings["CRMPassword"]; ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential.UserName = username; credentials.Windows.ClientCredential.Password = password; OrganizationServiceProxy serviceproxy = new OrganizationServiceProxy(urlcrm, null, credentials, null); IOrganizationService service; service = (IOrganizationService)serviceproxy; //DELETE from entity crm QueryByAttribute q_deletecontact = new QueryByAttribute("contact"); q_deletecontact.ColumnSet = new ColumnSet(new string[] { "firstname", "lastname", "emailaddress1" }); q_deletecontact.Attributes.Add("emailaddress1"); q_deletecontact.Values.Add("jhon@mial.com"); EntityCollection deletecontacts = service.RetrieveMultiple(q_deletecontact); if (deletecontacts.Entities.Count > 0) { foreach (Entity _deletecontact in deletecontacts.Entities) { service.Delete(_deletecontact.LogicalName, _deletecontact.Id); Console.WriteLine("delete contact success!"); Console.ReadKey(); //finish //lets run the program } } //thanks for wathing //see you in the next tutorial //happy coding :) } } }
CRM 4.0 - Retrieve data crm |
Step 1.
we make new class with the name crmclass or whatever else and begin make capacity for recover information crm
using Microsoft.Crm.Sdk; using Microsoft.Crm.Sdk.Query; using Microsoft.Crm.SdkTypeProxy; using Microsoft.Crm.Sdk.Metadata; using Microsoft.Crm.SdkTypeProxy.Metadata; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; namespace CRMTutorial { class CRMClass { public BusinessEntityCollection getallrecod_byexpression(CrmService _crmservice, string _entityname, string[] _columnset) { QueryExpression q_expression = new QueryExpression(_entityname); q_expression.ColumnSet = new ColumnSet(_columnset); RetrieveMultipleRequest request = new RetrieveMultipleRequest(); request.Query = q_expression; request.ReturnDynamicEntities = true; RetrieveMultipleResponse response = (RetrieveMultipleResponse)_crmservice.Execute(request); BusinessEntityCollection returnentities = response.BusinessEntityCollection; return returnentities; } } }
Step 2.
just call the function in main program
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Crm.Sdk; using Microsoft.Crm.Sdk.Query; using Microsoft.Crm.SdkTypeProxy; using Microsoft.Crm.Sdk.Metadata; using Microsoft.Crm.SdkTypeProxy.Metadata; using System.IO; namespace CRMTutorial { class Program { static void Main(string[] args) {
//create object from crm class
CRMClass mycrmclass = new CRMClass();
BusinessEntityCollection entities = mycrmclass.getallrecod_byexpression(service, "your entity name", new string[] { "your attribute name" }); if (entities.BusinessEntities.Count > 0) { foreach (DynamicEntity entityname in entities.BusinessEntities) { string attributetoshow= entityname.Properties["your attribute name"].ToString(); } } } } }
finish :)
thanks for reading
CRM is a business arrangement that helps organizations enhance promoting, deals, administration and responsibility to its clients to build the productivity of the association, while enhancing the client experience. Presently I need to share a tad bit involvement being developed crm. Acctualy I am Microsoft Dynamic CRM 2011, however for some anticipate still utilize crm 2007. so I need to relocate my code from element crm 2011 to dynamic crm 2007. It's exceptionally defferent code
- config
- Main Program
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Crm.Sdk; using Microsoft.Crm.Sdk.Query; using Microsoft.Crm.SdkTypeProxy; using Microsoft.Crm.Sdk.Metadata; using Microsoft.Crm.SdkTypeProxy.Metadata; using System.IO; using System.Xml.Linq; using System.Xml; using System.Configuration; namespace CRMTutorial { class Program { static void Main(string[] args) { string _crmserviceurl = ConfigurationManager.AppSettings["CRMServerURL"]; string _organization = ConfigurationManager.AppSettings["CRMOrganization"]; string _username = ConfigurationManager.AppSettings["CRMUsername"]; string _password = ConfigurationManager.AppSettings["CRMPassword"]; string _domain = ConfigurationManager.AppSettings["CRMDomain"]; CrmAuthenticationToken mytoken = new CrmAuthenticationToken(); mytoken.AuthenticationType = 0; mytoken.OrganizationName = this._organization; NetworkCredential mycredential = new NetworkCredential(); mycredential.UserName = this._username; mycredential.Password = this._password; mycredential.Domain = this._domain; CrmService service = new CrmService(); service.Url = _crmserviceurl; service.UseDefaultCredentials = false; service.CrmAuthenticationTokenValue = mytoken; service.Credentials = mycredential; /*Your code here call the service crm */ } } }