CRM, SSIS & Integrations ...configuring CRM as a non-coder
  • Home
  • Categories
    • Visual Studio
    • KingswaySoft
    • SSIS
    • JavaScript
    • CRM
    • SQL
    • ERP
    • Azure
    • How-to
    • Clubtimiser A/S
    • Office
    • Personal
  • About me
  • Privacy Policy
CRM, SSIS & Integrations
  • Home
  • Categories
    • Visual Studio
    • KingswaySoft
    • SSIS
    • JavaScript
    • CRM
    • SQL
    • ERP
    • Azure
    • How-to
    • Clubtimiser A/S
    • Office
    • Personal
  • About me
  • Privacy Policy
  • Home
  • CRM
  • How-to
  • JavaScript
  • Fix: Business Proces Flow not updating stepname

Fix: Business Proces Flow not updating stepname

January 30, 2019 Leave a Comment Written by Thomas

In january 2019, I started getting reports from customers, that their business process flows was not updating the stepname on opportunity records anymore. Logs showed, the fields were updated in december 2018, but suddenly stopped working.

Ofcause I started to look into this, and what I found was, that the fields that were being updated, was actually deprecated in Dynamics 365. Somehow the fields were still being updated – but that’s a different story. The issue at hand is, the fields are not being filled out/updated – what to do?

From my personal testing (creating a new entity on a clean environment with BPF), I am unable to find any way to fetch the stagename from the active stage using standard CRM functionality.

Looking into the matter, I found this forum post: https://community.dynamics.com/crm/f/117/t/267468

This post described how to get the data with javaScript. I would prefer, if it was easily available inside standard CRM, but I tried the code out:

// This function fetches the active stage on load, and sets the name of the active stage to a custom specified field
function formonload() {
Xrm.Page.data.process.addOnStageChange(getStage); // Trigger the function when move to next stage.
getStage();
}
// this getStage function is triggered by the formonload function, which fetches the name of the active BPF
function getStage() {
var activeStage = Xrm.Page.data.process.getActiveStage(); // Retrieve the active stage
var stageId = activeStage.getId();
var stagename = activeStage.getName(); // Retrieve the name of the active stage
Xrm.Page.getAttribute("ct_js_stagename").setValue(stagename); // set the name into the specified field
}

This piece of code worked like a charm, and the specified field is updated on stage change.

CRM, How-to, JavaScript
Dynamics365, How To, JavaScript, Solution
JavaScript basics: Conditionally hide sections and tabs
Fix: Dynamics 365 App for Outlook missing in navigation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

The author

KingswaySoft MVP & Microsoft certified professional

My name is Thomas and I am a consultant at a company called netcompany A/S in Denmark. My primary focus is working with SSIS and KingswaySoft, where I perform integrations and datatranformations.

Click for more info

Recent Posts

  • Difference between two dates (SQL, SSIS and JavaScript)
  • Easy way to fetch row count for all tables in a SQL database
  • Create Application user in Azure for use in Dynamics 365
  • SSIS Basics: Merge join
  • Open dashboards in a new window

Useful information

  • Installation guide to KingswaySoft
  • Software download list
  • CRM Object Type Codes
  • CRM State & Status codes
  • Script Repository

Archives

  • May 2020 (1)
  • February 2020 (1)
  • January 2020 (2)
  • August 2019 (1)
  • May 2019 (1)
  • February 2019 (2)
  • January 2019 (2)
  • November 2018 (1)
  • September 2018 (1)
  • August 2018 (3)
  • May 2018 (4)
  • December 2017 (2)
  • August 2017 (1)
  • February 2017 (1)
  • November 2016 (4)
  • October 2016 (1)
  • September 2016 (2)
  • August 2016 (5)
  • June 2016 (4)
  • May 2016 (3)

Useful blogs/links

Henrik Jensen, my good friend and colleague, has a blog regarding EVERYTHING Dynamics crm. He's got 50+ certifications, and he is a force to be reckoned with. Link to his blog (danish): crmblog.dk

KingswaySoft have developed an outstanding piece of software for datamanagement to and from CRM, and I can recommend this toolkit for nearly every situation. Link to their website: kingswaysoft.com

Tag Cloud

Azure Bug CRM 2015 CRM 2016 CRM Online Data Dynamics365 ERP Excel How To JavaScript KingswaySoft Log News Office Outlook Personal Solution SQL SSIS Visual Studio

Categories

  • Azure (2)
  • Clubtimiser A/S (1)
  • CRM (30)
  • ERP (2)
  • How-to (14)
  • JavaScript (3)
  • Office (3)
  • Personal (4)
  • SQL (2)
  • Visual Studio (23)
    • SSIS (23)
      • KingswaySoft (14)

Disclaimer

The information given on the website is tested on a mixture of live production environments and test environments, and therefore I cannot guarantee my information will work for you, if you attempt to follow my steps.
If you experience problems, please feel free to contact me.

@June 7th 2016