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.
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.
That's good to hear. We're you able to get the submitted form inputs from the webresource from session storage?
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);
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.
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102