Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

[CRM9.1] Unable to set stage on opportunity

$
0
0

Hello everyone,

I encountered a problem with the new api, setting an stage of opportunity doesn't work as intended, my code looks like this:

var entityFormOptions = {};
        entityFormOptions["entityName"] = "opportunity";
        entityFormOptions["selectedStageId"] = "D3CA8878-8D7B-47B9-852D-FCD838790CFD"; //it's an id of 3rd stage
        Xrm.Navigation.openForm(entityFormOptions).then(
            function (success) {
            },
            function (error) {
                console.log(error);//no error here
            });

I tried also following methods from API:

Xrm.Page.data.process.moveNext( function(val) {console.log(val);});

// all required fields must be filled so it's not for me

Xrm.Page.data.process.setActiveStage("6b9ce798-221a-4260-90b2-2a95ed51a5bc", function(val) {console.log(val);});

//It kind of works but when it prints "success" then whole process flow stays at same stage:

//Xrm.Page.data.process.getSelectedStage().getId() and Xrm.Page.data.process.getActiveStage().getId()

//says that correct stage is selected but... yeah

What I need:

I'm looking for a way to open new form with specified stage activated.

There is no problem when comes to CRM 8.2, everything work as intended using old API.


Viewing all articles
Browse latest Browse all 143529

Trending Articles



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