SBX - Search With Button

SBX - Forum Post Title

Can't use setActiveStage js-function

Microsoft Dynamics CRM Forum

Anatoliy Veshemirsky asked a question on 18 Nov 2017 2:35 PM
My Badges

Question Status

Verified

Hi!

I have created simple example (set this function onLoad form):

function test() {

var procid=Xrm.Page.getAttribute("processid").getValue();
if (procid=="9f032107-53b0-490b-b178-43ca28e42ec4")
{
  var stcopy = Xrm.Page.data.entity.attributes.get("elko_stageid").getValue();
  var GUID = "";
  if (stcopy="5705561b-ded6-47b9-a273-25932a264f1d")
  {
   GUID="fbef4b74-ec42-4a27-92a6-d683ca2a31d5";
   Xrm.Page.data.process.setActiveStage(GUID,
                                    function () {
                                        //no event
                                    });
  }

}

}

But I always getting an error - "Invalid".

There are three reasons why this value may be returned:

  • The stageId parameter is a non-existent stage ID value.

  • The active stage isn’t the selected stage

  • The record hasn’t been saved yet.

Have anybody some ideas to solve it? 

Thanks!

Reply
Anatoliy Veshemirsky responded on 21 Nov 2017 8:59 AM
My Badges
Verified Answer

I have solved it. I used only customization (via BPF).

Reply
CrmMouss responded on 18 May 2018 10:37 AM
My Badges

hi Anatoly i have the same problem with js

what can i do with customization ?

Reply
Anatoliy Veshemirsky responded on 21 Nov 2017 8:59 AM
My Badges
Verified Answer

I have solved it. I used only customization (via BPF).

Reply

SBX - Two Col Forum

SBX - Migrated JS