Thursday, 5 March 2015

20:50 - 11 comments

Create a button inside the form using JavaScript | MS CRM

Create a button inside the form using JavaScript

Description:
 Add a button in the form and between the fields JavaScript functions are handy.

JavaScript Code:
function addButton(attribute_name) {
    if (document.getElementById(attribute_name) != null) {
        var FieldID = "field" + attribute_name;
        var elementID = document.getElementById(attribute_name + "_d");
        var div = document.createElement("div");
        div.style.width = "20%";
        div.style.textAlign = "right";
        div.style.display = "inline";
        elementID.appendChild(div, elementID);
        div.innerHTML = '<button id="' + FieldID + '" type="button" style="margin-left: 4px; width: 50%; " >Add Me</button>';
        document.getElementById(attribute_name).style.width = "80%";
        document.getElementById(FieldID).onclick = function () {onbuttonclick(); };
    }
}

function onbuttonclick() {
var sam= Xrm.Page.getAttribute("new_name").getValue();
    alert('welcome to'+sam);
}
           

Placing a Button:
            After Adding JavaScript function to the form property the position of the button to be configured by add the field name under which button should display in Handler property -> parameters (as in figure  below)



Output:
Then the output will be like this








11 comments:

This comment has been removed by the author.

I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.

rpa training in bangalore
best rpa training in bangalore
RPA training in bangalore
rpa course in bangalore
rpa training in chennai
rpa online training

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
Best Devops Training in pune
Best Devops Training institute in Chennai

Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
Python Online certification training
python Training institute in Chennai
Python training institute in Bangalore

I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
data analytics courses

Such a useful article, A lots of Languages and Technologies are here to learn for enhance the technical enlightenment.Thanks for this Informative Blogs and keep sharing
python training in chennai | python training in annanagar | python training in omr | python training in porur | python training in tambaram | python training in velachery

Your work is very good, and I appreciate you and hopping for some more informative posts
<a href="https://www.excelr.com/business-analytics-training-in-pune/”> Courses in Business Analytics</a> Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.

Post a Comment