Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

can we add html control on ribbon button and get the input from html control and put that in particular field if yes then got problem as following i have present let see!

(0) ShareShare
ReportReport
Posted on by 10

hey everyone 

 i am Nitesh i am learning  Dynamic  crm 365 from one and half month i mean i am in still in running phase will you please help me? 

my question is :- can we add html control on ribbon button and get the input from html control and put that in particular field .

i got answer yes so i tried but i get some error will you please check and let me know as soon as possible 

i have create a simple web resource name new_nitesha it is html rght  and i have called it using javascript 

1)this is my html file 

html><head>
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script type="text/javascript">
function startSample() {
try {

var a=window.parent.Xrm.Page.getAttribute("new_jobtitle").getValue();
a.setValue("fsdh");
}

//parent.Xrm.Page.data.entity.attributes.get("new_jobtitle").setValue("datat");
}
catch (e) {
Xrm.Utility.alertDialog(e.message);
}
}

</script>
<title>
simple page for crm
</title>
<meta>
<meta>
<meta>
<meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta></head>
<body style="overflow-wrap: break-word;">
<h1>Insert Data into contact field</h1>
jobtitle:-<input type="text" id="data"><br>
<input type="submit" value="submit" onclick="startSample();">

</body></html>

2)this is my javascript file 

function Plan(){
var windowOptions = { height: 400, width: 400 }
Xrm.Navigation.openWebResource("new_nitesha",windowOptions);

}

note:-i have used ribbon workbench 2016 to add button on ribbon and i have added one command that is action in this action i have add javacript which is below and published 

please check and let me know the same

 thank you!

  Regards,

Nitesh Devghare

 

*This post is locked for comments

  • Community Member Profile Picture
    6,016 on at
    RE: can we add html control on ribbon button and get the input from html control and put that in particular field if yes then got problem as following i have present let see!

    i got solution .Thank you !  

  • Community Member Profile Picture
    6,016 on at
    RE: can we add html control on ribbon button and get the input from html control and put that in particular field if yes then got problem as following i have present let see!

    Thanks alot Goutam Das !

    sorry for late reply!

    My question was not actually correct !  

    Actually i wanted to run html page on button click ,the html control will take input and update the field on form. By the way i have achieved it.

    Thank you so much for replying ! keep in touch.  

  • gdas Profile Picture
    50,091 Moderator on at
    RE: can we add html control on ribbon button and get the input from html control and put that in particular field if yes then got problem as following i have present let see!

    Hi Nitesh,

    What you are trying to achieve is wrong , Can you please tell what exactly your requirement.

    Why you want to add HTML in the ribbon? ribbon is used for specifically to add button only. You have  forms and there you can add easily your HTML and then using ribbon work bench create button and call your JS function , You can access form html input text from ribbon action as well.

    Check here below reference -

    How to add webresource in the forms-

    crmbook.powerobjects.com/.../html-web-resources

    Accessing web resource control-

    alagunellaikumar.blogspot.com/.../access-html-webresource-control-from.html

  • Pawar Pravin  Profile Picture
    5,237 on at
    RE: can we add html control on ribbon button and get the input from html control and put that in particular field if yes then got problem as following i have present let see!

    Hi Nitesh Devghare,

    As per your subject question first of all it's not possible to add HTML control over ribbon. 

    In case of user input you can use js action on button click and easily put value into particular field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans