Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How to save modification on page onload on quotedetail page?

Hello everyone,

i have very important task, i am stuck in this, please help me in this.




this is my quote product, in this product have spec tab which is related to quote product  specification.


when ever i update or modified this specification and save this quote product , and then reload the page, then changes are gone.


i want do the JavaScript code on page onload event, and i want changes when i refresh a page.





Memorable Member
Memorable Member

Are these items all part of the same table or are some of the fields being pulled from a different table for display purposes?

And you say you want to use a Javascript an onload event - does that code currently exist and what does it do?

If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Dual Super User
Dual Super User


Specifications looks like a field on the from of quote that correct?

I don't understand what you need from the onload event as in normal scenarios this should be reflected automatically upon save you can see the new changes.


I believe there might be something in the background clearing the field value.


If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
Helper V
Helper V

@Dyna03 If you are setting that field value via Javascript on Onload event for the first time, Then put in form type(create form, update form) condition.

Or if you want to set that field when it does not contains any data then add null check.

If you manually filling the field and it is getting removed when form is loading then you need to check for existing JS registered on that form has logic on that particular field.

Super User
Super User

Hi @Dyna03 


You can use IsDirty function to get the unsaved field logical name and proceed your steps.


Syntax :



Url for Reference:



Please mark as Answer if it is helpful and provide Kudos

Subscribe :
Follow me on Twitter : @rampprakashd
Blog :


@gowrihalan04  yes i have alread one js on form onload event

belove is code on quoteine onload 

function onLoadSetSpec(executionContext) {
	var formContext = executionContext.getFormContext();
	var quoteLookup = formContext.getAttribute("quoteid").getValue();
	var quoteDetailIDAX = formContext.getAttribute("sar_quotedetailidax").getValue();
	if ((quoteLookup != null)) {
		var quoteGUID = quoteLookup[0].id;
		quoteGUID = quoteGUID.replace('{', '').replace('}', '');"quote", quoteGUID, "?$select=name,revisionnumber,sar_quoteidax,statecode").then(
			function success(result) {
				var name = result["name"];
				var revisionnumber = result["revisionnumber"];
				var revisionnumber_formatted = result["revisionnumber@OData.Community.Display.V1.FormattedValue"];
				var quoteIDAX = result["sar_quoteidax"];
				var statecode = result["statecode"];
				var statecode_formatted = result["statecode@OData.Community.Display.V1.FormattedValue"];

				var previousRevionNumber = revisionnumber - 1"quote", "?$filter=revisionnumber eq " + previousRevionNumber+ " and statecode eq 3  and  sar_quoteidax eq '" + quoteIDAX + "'").then(
					function success(results) {
						for (var i = 0; i < results.entities.length; i++) {
							var quoteid = results.entities[i]["quoteid"];
							//alert("Last Close Quote : " + quoteid);
							if (quoteid != null) {"quotedetail", "?$select=quotedetailid,quotedetailname,_quoteid_value,sar_specificationsenglish,sar_specificationsfrench,sar_specsreviewed&$filter=_quoteid_value eq '" + quoteid + "' and  sar_quotedetailidax eq '" + quoteDetailIDAX + "'").then(
									function success(results) {
										for (var i = 0; i < results.entities.length; i++) {
											var quotedetailid = results.entities[i]["quotedetailid"];
											var quotedetailname = results.entities[i]["quotedetailname"];
											var _quoteid_value = results.entities[i]["_quoteid_value"];
											var _quoteid_value_formatted = results.entities[i]["_quoteid_value@OData.Community.Display.V1.FormattedValue"];
											var _quoteid_value_lookuplogicalname = results.entities[i]["_quoteid_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
											var sar_specificationsenglish = results.entities[i]["sar_specificationsenglish"];
											var sar_specificationsfrench = results.entities[i]["sar_specificationsfrench"];
											var sar_specsreviewed = results.entities[i]["sar_specsreviewed"];
											var sar_specsreviewed_formatted = results.entities[i]["sar_specsreviewed@OData.Community.Display.V1.FormattedValue"];
									function(error) {
					function(error) {

			function(error) {



I have 2 custom field in quoteline- sar_specificationsenglish and  sar_specificationsfrench


if a update this 2 field on quoteline and save quote line and after revise a quote, then changes were gone.

so i write that code for revise quote. 


Now the problem with draft quote.


my quote is on draft state, and i modified those two field on quoteline. and save that form.


after refresh this page, then changes are gone 


so what to do for this issue

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (3,034)