web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Workflow and JavaScript on same BPF stage

(0) ShareShare
ReportReport
Posted on by 240

Hey

Just wondering how a JS and WF would work out if used on the same BPF stage.

I have fields in my BPF - A, B, and C.

1. B remains a hidden field by script.

2. When A is filled in, B will become visible and editable.This is also by script.

3. When B is filled in and the task complete, I want C to be marked off as complete.

I am using script to hide B initially, and ensure that it becomes visible when A is filled in. Now I want to ensure that when the task in B is complete, C would be marked off as complete . I was trying to do a workflow which would check if B is complete, so it can mark C off as complete.

But my workflow is not running like it should.. Is there anything I should change?

I have the same question (0)
  • H V Profile Picture
    351 on at

    Hi,

    As per my understanding, you are triggering a workflow on field B change or on complete.

    Once you will save a record then Workflow will call.

    Workflow doesn't call when you change tye field, but workflow will call when you change the field and save the record.

  • Aneeqa Pervaiz Profile Picture
    240 on at

    Yes, I am triggering a workflow when Field B is complete.

    1. So, I fill in field B. Save the record,.

    2. Then, I wait for the task entered in B to be completed. Field B is activity basically.

    3. So, when that task in Activity entity is complete, the field C should be marked off as complete.

    But, the wf does not trigger when the activity completes. My workflow checks the condition - of the activity status of B - and if its complete, then C should be marked off as complete.

    I just wanted to know if there should be any change i should make to my workflow.

  • Suggested answer
    Satish Tiwari - CRM Profile Picture
    on at

    Hello,

    You can use Business rule as well for this scenario and in below article you can find more details -

    docs.microsoft.com/.../create-business-rules-recommendations-apply-logic-form

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Aneeqa,

    If I understood correctly, you are creating an activity record when field B is filled on an Entity A.

    Once Activity is completed (closed), you want to set field C's value (as completed) on Entity A.

    In this scenario, you can either use a Business Rule or Workflow to do the job.

    As you said, it is not working, to troubleshoot, can you please share a screenshot of your workflow configuration?

    Also, is it a Real-time or Background workflow? And on which entity it is triggered?

    Pleas note, if workflow is trigger on Activity entity's completion, field C value will change in background, user need to refresh/re-open the form in order to see update value in field C.

    Please share more details on your workflow.

    Best,

    Wahaj

  • Aneeqa Pervaiz Profile Picture
    240 on at

    Hey Wahaj,

    So my workflow is still not working. I initially changed it to real-time workflow. But that was causing problems across the environment. The records would not save/give an error on performing any task. 

    I have tried my workflows on both Entity A (Opportunity) and the activity entity. Attaching configurations for both. Can you let me know what would be the problem here.  

    • My main entity where the BPF is located - Opportunity. 
    • Stage where the workflow will be applied - Introduction 
    • In the Introduction stage - there is field Introduction Type which has different options. 
    • Based on chosen option - a link field becomes visible - this is done by script. 
    • The link field that becomes visible is looking upto activity entity. The only three activity types used are Appointment, Phone Call, Email
    • When the link field (field B) is filled in and when that activity is complete, I want the third field (Introduction completed) to be marked off as complete. 

    Attached are two workflows for Appointment option. 

    1) Workflow on Activity type entity (Appointment):

    pastedimage1595371512710v1.png

    2) Workflow on main entity (Opportunity):

    pastedimage1595371592063v2.png

    A workflows both ways is not running like it should. 

    Would appreciate any help on this. 

    Thank you. 

  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi Aneeqa,

    Let's do it this way:

    1. Uncheck "Automatically delete completed workflow jobs". This way, you can troubleshoot if the workflow triggered on the correct event or not, secondly, you can see what happened during the execution (validate if conditions).
    2. I noticed your workflow is created for the Appointment entity, however, in the condition, your condition says "Introduction Type=Phone Call".

    pastedimage1595453255173v1.png

    Let me know the results of the execution.

    Furthermore, please note, you have to wait for the back-ground workflow to be completed. This means you won't see changes to this field instantly and you had to refresh the form or re-open the form to see the results (once workflow executed successfully).

    For the best user experience, I would suggest the following:

    • The user selects the intro type and activity created accordingly.
    • The user marks the activity as closed (in the activities tab or timeline), a real-time workflow updates the status field on the Opportunity.

    You need to create 3 real-time workflows (for each activity type), and on completion simply update the related opprtunity.

    As you said, real-time workflows are not working for your environment, you are better to judge your environment, however, feel free to discuss.

    Try these solutions, and let me know.

    Happy to help you.

    Best,

    Wahaj

  • Aneeqa Pervaiz Profile Picture
    240 on at

    Hello,

    Turns out it was the error of mistakenly choosing Phone Call on the Appointment entity. My workflows are running smoothly now. However, the suggestions were awesome, and I will keep them in mind for future purposes.

    Thanks a bunch!

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    I'm glad it worked out.

    Stay safe,

    Wahaj

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans