web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Active Discussion

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

  • Pawar Pravin Profile Picture
    5,237 on at

    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.

  • gdas Profile Picture
    50,091 Moderator on at

    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

  • Community Member Profile Picture
    on at

    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.  

  • Community Member Profile Picture
    on at

    i got solution .Thank you !  

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans