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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to fix BPF displaying on non sales leads

(0) ShareShare
ReportReport
Posted on by 187

Hi community,

I have a use case of which a sales custom BPF process is displaying on a target instance where the field record type is sales even though it is not. Can some provide some guidance if by creating a business rule would fix this issue?

Thanks in advance

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Sol007,

    You want to hide the BPF based on one field value, right?

    If so, you can achieve it through js code:

    setVisible (Client API reference) in model-driven apps - Power Apps | Microsoft Docs

    function hideBPF(executionContext)
    {
    var formContext = executionContext.getFormContext();
    var type = formContext.getAttribute("new_type").getValue();//the field you need
    if(type == 0)//type is sales
    formContext.ui.process.setVisible(false);
    else
    formContext.ui.process.setVisible(true);
    }
    pastedimage1642495315647v4.png

    open one entity form to add the js code:

    pastedimage1642498526749v5.png

  • Verified answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Please register above code on onload event of your form too addition to onchange event.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Sol007 Profile Picture
    187 on at

    Hi Leah Ju,

    It appears the use case is to hide the BPF appearing on non-sales lead forms. Will this still be achievable with js code or via a business rule logic?

    Thanks

  • Community Member Profile Picture
    on at

    Hi Sol007, 

    Can you explain what is 'non-sales lead forms'?

    And you can't  hide BPF through business rule, js code is one good way.

  • Sol007 Profile Picture
    187 on at

    There are more than one active lead forms that are non sales and the BPF appears on all of them. Idea is to make the BPF non visible to these other forms? Could it non visible through security roles on each forms?

  • Sol007 Profile Picture
    187 on at

    Hi Leah Ju,

    Please screenshot, on the Lead form there are several other forms which the BPF appears on creating a new lead but the BPF should only be visible for record type Sales. Is this only achievable with js code? Thanks in advance.

    Test_5F00_LI-_2800_2_2900_.jpg

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Sol007,

    If you want to show/hide BPF based on the type field value, It is only achievable with js code.

    And you need logic name of the type field and correct value of sales options in js code.

    Go Settings > Customizations > Customize the system > Entities > Lead > Fields to find the type field you are using.

    pastedimage1644214938033v1.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans