Skip to main content

Notifications

Announcements

No record found.

Customer Service forum
Suggested answer

system entity stage skip in BPF based on a field value in Customer service module.

Posted on by 5
Scenario - based on an optionset value in the first stage of BPF , i want to skip the next stage in bpf .
 
i am working on Case entity main form where it was configured with a BPF "phone to case" , i have added a custom field which is optionset in to the main form and added the same in stage 1(Identify) of BPF.. As per my scenario i need to skip to Resolve Stage when skillSet=javascript.  i have written some js code but its not working as expected .here is the code 
function AdvanceBPF(executionContext) {
    var formContext = executionContext.getFormContext();
    var skillSetVal = formContext.getAttribute("crbaa_skillset").getValue();
    var Stage1 = "15322a8f-67b8-47fb-8763-13a28686c29d";
    var Stage2 = "43705509-726f-499c-9351-6058f9139011";
    var Stage3 = "14f57c64-2bcd-4146-be63-abf69d29a2de";
    
    var entity = {};
    entity["activestageid@odata.bind"] = "/processstages(" + Stage2 + ")";
    entity["traversedpath"] = Stage1 + "," + Stage2;
    var BPFId = "47c0f979-8275-ef11-a670-000d3ac893ab";
if(skillSetVal==878810000){
    
    var req = new XMLHttpRequest();
    req.open("PATCH", Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.2/phonetocaseprocesses(" + BPFId + ")", true);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 204) {
                alert("Success");
            } else {
                alert("Error");
            }
        }
    };
    req.send(JSON.stringify(entity));
}
else{alert("Not Moved the stages")}
     
}
Can Some one guide me how to skip the stage .
  • Suggested answer
    gulshankhurana Profile Picture
    gulshankhurana 38 on at
    system entity stage skip in BPF based on a field value in Customer service module.
     
    I'm not into code so here's my suggestion for achieving it in a no-code, out-of-the-box way:
     
    Create a solution and add the 'Phone to Case' BPF in that solution.
    Open the BPF by double-clicking on it.
    In the UI that appears, add the needed 'skillset' option set column in the first 'Identify' stage.
    After the Identify stage, add a condition and connect one path of the condition with the 'Resolve' stage.
     
    The following video demonstrates it clearly:
    https://www.youtube.com/watch?v=InUNdHtKZ4E
     
    Kind regards
    Gulshan

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,572 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,706 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans