Convert TextBox field to Button with javascript

Hi, we can add a button to a solution crm with The Ribbon Workbench ribbonworkbench , Or we can convert a textBox Filed to button ,
So I create a filed type text and i added a code with javascript to change this field to button.
txtbox convert to button Dynamics crm 2013
this is the code of the custum button :

function ajoutButton(new_convertir) {
if (document.getElementById(new_convertir) != null) {
var sFieldID = "field" + new_convertir;
var elementID = document.getElementById(new_convertir + "_d");
var div = document.createElement("div"); = "50%"; = "right"; = "inline";
elementID.appendChild(div, elementID);
div.innerHTML = ' Convertir';

documew_cnt.getElementById(neonvertir).style.width = "0%";
document.getElementById(sFieldID).ondblclick = function () { DateDifference(); };

I get this result :

How To retrieve the list of organizations using C#

Open your solution in VS , right-click the name of the project that you want to add the service to, and then click Add Service Reference.

The Add Service Reference dialog box appears


add service reference

click Discover.

All WCF services in the current solution are added to the Service list.

In the Service list, expand the node for the service that you want to use and select a service contract.

In the Namespace box, enter the namespace that you want to use for the reference

Click OK to add the reference to the project.

A service client (proxy) is generated, and metadata describing the service is added to the app.config file

Then add the following references assemblies

  1. Microsoft.crm.sdk.proxy
  2. Microsoft.Xrm.Sdk
  3. System.ServiceModel




and this is the result


fetchxml linked-entity with lookup filter

Hello, In this article i will share with you how to add a lookup filter to a linked entity with Fetchxml

In the serviceappointment entity ,  i added  a lookup  field “new_contract”  to diplay the list of contract,
 so i want to display the list of contract of the selected account.

i create a fetchxml filter and i added it to javascript function :

function preFilterLookup() {
Xrm.Page.getControl("new_contrat").addPreSearch(function () {

function getlookupCustomer()
var lookupObject = Xrm.Page.getAttribute("customers");

if (lookupObject != null) {

var lookUpObjectValue = lookupObject.getValue();

if ((lookUpObjectValue != null)) {

var lookuptextvalue = lookUpObjectValue[0].id;
return lookuptextvalue;

function addLookupFilter() {
var customer = getlookupCustomer();

if (customer != null) {

fetchXml = ""
+ " "
+ "";

MS Dynamics CRM Experience

Hello and welcome to my blog,
I’m a Microsoft Dynamics CRM Developer based in Tunisia. I’ve been working with Microsoft Dynamics CRM 2013 on premise and online and Microsoft Dynamics CRM 2015 and CRM2016
I will share with you my experience in Microsoft dynamics CRM and custom development
This blog is for both beginners and the more experienced CRM developers. Please feel free to add comments or to suggest blog topics. You can contact me via the blog comments or via Linkedin.