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

Notifications

Announcements

No record found.

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.

I have the same question (0)
  • Suggested answer
    MikeC282 Profile Picture
    2,175 on at

    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.

  • roger40 Profile Picture
    5 on at

    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);

  • MikeC282 Profile Picture
    2,175 on at

    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

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans