Quantcast
Channel: CRM Development Forum
Viewing all articles
Browse latest Browse all 888

Field not saving data

$
0
0

I have any issue, maybe someone has seen this before and handle it. I have a coupld of custom fields on Quote that I am using to do a calculation and then saving the reulting value to the OOTB totalAmount filed(Schema name baseamount). This is a readonly/disabled field on the Quote form. When I hit save I can see the value in the field change to the correct one but once the form closes and I reopen, the value is set back to zero. I have tried to use setSumbit to always and still its not working. I created a custom currency field set to readonly/disable with to act as a copy. i set the same total value to that field and the value is saved. So now I am really confused as to what going on. An example of the code that I have written is posted below. Any help is appreciated. Thanks

                if(varMyTerm != null && varMyPricePerMonth != null){
                        varMyTerm = (isNaN(varMyTerm)?0:varMyTerm);
                        varMyPricePerMonth = (isNaN(varMyPricePerMonth)?0:varMyPricePerMonth);
                        var totalAmount = varMyTerm * varMyPricePerMonth;
                        Xrm.Page.getAttribute("baseamount").setValue(totalAmount);
                        Xrm.Page.getAttribute("vcs_totalcontractvalue").setValue(totalAmount);
                        //Make the base field submitmode always so we can force submit.
                        Xrm.Page.data.entity.attributes.get("baseamount").setSubmitMode("always");
                        Xrm.Page.data.entity.attributes.get("vcs_totalcontractvalue").setSubmitMode("always");                    
                    }


Viewing all articles
Browse latest Browse all 888

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>