Get the text data or GUID value of a lookup field with javascript code

Hi ,

in this article we talk about "Get the text data or GUID value of a lookup field with javascript code"

Sometimes, we want to learn lookup guid value and text with javascript.

Question : How can we learn this values. 
Answer : with javascript code

<script>
function learnLookupValues()
{
var lookupObject = Xrm.Page.data.entity.attributes.get("vendorID").getValue();
if(lookupObject  != null ) 
{

alert("Lookup field text" + lookupObject[0].name);
alert("Lookup field Id" + lookupObject[0].id);

}
}
</script>

let's explain the code !

Firstly, we catch up lookup field 
"

Xrm.Page.data.entity.attributes.get("vendorID").getValue();

"

then, we have to control this value 

if(lookupObject  != null )

Finally. we will use these values

alert("Lookup field text" + lookupObject[0].name);
alert("Lookup field Id" + lookupObject[0].id);

thats all 
Have a good day

Where is write the javascript code in html page

Hi, 

in this article we talk about "Where is write the javascript code in html page". This is important topic for you because javascript code will be different location in the html page.

Javascript code must be inserted between <script> and <script> tags.

for Example 

<script>
document.getElementById("txtName").innerHTML = "my name is Cengiz Atilla";
</script>

We can write the javascript code in head tag or body tag. Just we have to  be careful the javascript code will be in script tags.

We can write the Javascript code in html or external js file. If we write an external js file, we need to refer to the external js file on the html page when we want to use it.

for example 

testJavascriptCode.js 

function myFunction() {
   document.getElementById("txtName").innerHTML = "My name is Cengiz ATİLLA";
}

test.html

<script src="testJavascriptCode.js"></script>
<head>
<title> Where is write the javascript code in html page </title>
</head>
<body>
Hello World
</body>

in this article we learned where can we write javascript code in html page.it is important because we usually write javascript code in html page.

 

Why we have to learn Javascript ?

Hi , 

In this article we talk about "Why we have to learn Javascript". 

We have to learn javascript because we develop web technology. Javascript is one of the 3 languages all web developer have to learn. 

If you want to be a developer, you have to learn these technologies

  1. HTML
  2. CSS
  3. Bootstrap
  4. Javascript
  5. for .net developers Asp.net MVC or MVC Core

You will be learn easy javascript because it is not difficult language. When we learn javascript then i will learn faster angularjs and nodejs.

Most popular question : which program i need to learn javascript.
Answer : Notepad 

We will learn JavaScript easily in this article line.

see you soon...

How can i use dynamics crm 365 trial version for development.

Hi, 

In this article we talk about how can i use dynamics crm 365 trial version for development. firstly, we need to have any company email address. Because the system is want to  company email address.

Step by step process

  1. Please visit https://trials.dynamics.com/ web site
  2. Find this word "Are you signing up on behalf of the customer or are you using this trial version for development purposes? Sign up here." then click "Sign up here" button
  3. when you click the submit button,one popup show you. Please select No, continue sign up
  4. Please fill in the "Welcome, let’s get to know you" form and click next button.
    important note : you have to write business email address and correct phone number.
  5. The system sends the phone verification sms sent. Please write sms code in website

thats all. You have a dynamics crm 365 for 30 days. You can use the dynamics crm 365. 

Get/Set field values in JavaScript for Dynamics CRM

Hi,

Sometimes we want to set or get field value from javascript . in this article we will learn it.
First we need to know dynamics crm field's name. Which field we want to set or get data.
As an example, we use the vs_customertaxno field.

we have to make javascript library on dynamics crm 2011.

javascript code for get data

Xrm.Page.data.entity.attributes.get("vs_customertaxno").getValue();

javascript code for set data

Xrm.Page.data.entity.attributes.get("vs_customertaxno").setValue(Value);

thats all
Have a good day

System user can not send email from workflow

Hi , 

If you are using the CRM 2011 system and system users can not send e-mails using workflows. You have to make these step your system

  1. Create new security role for example ( minimum system roles
  2. Business Management -> Miscellaneous Privileges - check the following fields
    1. Act on Behalf of Another User 
    2. Send Email as Another User 
  3. Assing the user new role ( minimum system roles

Thats all. 
Have a good day