-1

I have custom field called total ("new_test_total")and the field is calculated from two other fieldenter image description here

and I want to pass these total to the price list item amount what I have been done so far

I created another custom field called test and make these function on change the field Total amount

to pass the value of total amount to the field i create "new_test"

function update_Amount(){   Xrm.Page.data.entity.attributes.get("new_test").setValue(Xrm.Page.data.entity.attributes.get("new_test_total").getValue());}

and make mapping between price list item and Product

between the field test and the field amount

enter image description here

it works fine but when I try to change the field total by changing the parameter that it calculated based on it

the total amount change but i must save it twice(ctrl+s) to change the value of amount in price list item

1 Answers1

-1

I solved these problem by creating these function to change the field data based on the change of the meterfield or the change of the gross field

function update_test(){var x=Xrm.Page.data.entity.attributes.get("new_grossarea").getValue();var y=Xrm.Page.data.entity.attributes.get("new_meterprice").getValue();Xrm.Page.data.entity.attributes.get("new_test").setValue(x*y);}

and when the field new_grossarea changed i call the above function and when the new_meterprice changed i call the above function also and save the form the field amount in price list item is also changed based on the change of the field