Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Get an input from an html page that is shown when a user click a ribbon button

(0) ShareShare
ReportReport
Posted on by 5

Hello,

Some background of the problem:


-I have an entity called "booking contract"

-I want to create a ribbon button that renew the contract.

-By renewing a contract a new contract record should be created with the exact same information but not the same "end date" (that is a field)  and the start date of the new record will be automaticly set so it is the same as the end date of the contract being renewed.

-I want the user to input the new "end date" when he clicks on the "renew" button.

Basicly i want to display a form with just the end date to receive the user input when he clicks the renew button and use that end date and the information from the contract being renewed to create a new contract

Do you have any suggestions on how to do this?

There are 2 methods that I think could solve this problem:

-Create a quickcreate form and displaying it on button click. The form would have all the fields filled and invisible and the end date empty and visible. Then I would use information on that form to create the new contract.

-Create an HTML page with a form to input the new end date and get the value on the js script, but I have no idea how to get the value. I already searched but did not understand.

I never created a js script and this will be my first but I have some minor experience with plugins and custom workflows.

  • roger40 Profile Picture
    5 on at
    RE: Get an input from an html page that is shown when a user click a ribbon button

    Yes. it was hard and had to try alot of different stuff.

    what worked was installing crm sdk to get jquery.min file, create a web resource for it and upload that jquery file then in the HTML link to that web resource.

    Then I was able to close the HTML page with a custom button and able to get to the callback function of the navigate method in js script when HTML is closed

    and retrieve data in localstore set by the HTML.

    It not that it is too hard but the lack of documentation its crazy for such a simple thing.

  • MikeC282 Profile Picture
    2,148 on at
    RE: Get an input from an html page that is shown when a user click a ribbon button

    That's good to hear. We're you able to get the submitted form inputs from the webresource from session storage?

  • roger40 Profile Picture
    5 on at
    RE: Get an input from an html page that is shown when a user click a ribbon button

    PS: was able to solve this. i had to put the HTML code in the "source" tab and I was in rich editor tab, that was not specified anywhere on the internet

    Hello, ty for your help.

    I can open the HTML web resource but the page displays raw text instead of formated HTML.

    The code I'm using to open it:

    var navigationOptions = {

    target: 2,

    width: 400, 

    height: 300, 

    position: 2 

    };

    var pageInput = {

    pageType: 'webresource',

    webresourceName: 'Publisherprefix_Name of web resource'

    };

    Xrm.Navigation.navigateTo(pageInput, navigationOptions);

  • Suggested answer
    MikeC282 Profile Picture
    2,148 on at
    RE: Get an input from an html page that is shown when a user click a ribbon button

    Hey bud

    If you're gonna pop out a custom HTML webresource with a form in it and want to pass the form selection data back. There's no out of the box way to do it but you can store the form inputs in Windows session storage and then retrieve it after the form closes.

    developer.mozilla.org/.../sessionStorage

    So create a event listener and grab your form input values and store it in session storage and then retrieve it when you need it.

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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 102

Overall leaderboard

Product updates

Dynamics 365 release plans