Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Auto Populate Actual Revenue field from Estimated Revenue in Opportunity Close form

$
0
0

Hey Guys,

I want to auto populate the Actual Revenue Field in Opportunity Close form, from another field (ie. Estimated Revenue) when the Actual Revenue is NULL or =0.

 

I've tried wrote the Jscript below, It seems to be updating the Actual Revenue Field correctly but after it saves value is NULL. I believe it's overwriting my value with the opportunity close form's Actual Revenue Value.  Please HELP and happy holidays.

=============================================================================================

 

    if (event.Mode == 5) {

        // If status is won

        if (status == 1) {

            var ActualRevenue = Xrm.Page.data.entity.attributes.get("actualvalue");

            var ActualRevenueValue = ActualRevenue.getValue();

            var TotalForecastRev = Xrm.Page.getAttribute('onx_totalforecastrevenue').getValue();

            if (ActualRevenueValue == null) {

                ActualRevenue.setValue(TotalForecastRev);

            }

        }

    }

=============================================================================================

 


Viewing all articles
Browse latest Browse all 82002

Trending Articles



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