Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

In Force UCI mode enable\disable rule custom java-script action is not working.

(0) ShareShare
ReportReport
Posted on by 130

Hello All,

I am trying to hide custom ribbon button of home grid based on selected view. It is working fine in Classic mode but not working in Force UCI mode.

JavaScript is working fine, no errors and executed successfully. 

Is this any bug or what any solution/suggestions?

Thanks in advance.

  • Anshuman Trivedi Profile Picture
    130 on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Yes, I have checked but not working means (Only one time it work but when you change the view 3 or 4 times it wont even the code is not triggering.)

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Do you checked the last code that i shared ? its works for me in UCI.

  • Anshuman Trivedi Profile Picture
    130 on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Bro This code is working only in Classic mode but not in UCI Mode.

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Hello,

    Please close this thread if the reponse is useful, thank you !

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Hello partner,

    Please this sample code, it works for me.

    function viewSendForApprovalButton(selectedControl) {
    
        
        var gridControl = selectedControl;
        var viewSelector = gridControl.getViewSelector();
        var currentView = viewSelector.getCurrentView();
        var currentViewId = currentView.id.replace('{', '').replace('}', '');
        
        
        alert("CurrentViewId: " currentViewId);
        
        if(currentViewId == "00000000-0000-0000-00AA-000010001004")return true;
        else return false;
    
        
        
    }

    Use the viewSelector to get the current view ;) 

    Please tick as verified if the answer is useful. 

  • Anshuman Trivedi Profile Picture
    130 on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Hello,

    I have tried this solution but unfortunately it is not working.

    Also returning 0 or 1 instead of false or true is fix for Value rule in UCI Mode.

    Thanks

    Anshuman

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    Hello,

    Please can you try to return 1/0 instead of true/false.

    Mehdi El Amri

    Please tick as verified if the answer is useful. 

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    I will reproduce your use case and i will give you a feedback ASAP.

  • Anshuman Trivedi Profile Picture
    130 on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    I have already posted the Java Script Code which will return true or false on the basis of selected view.

    Please find the same in above replies

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: In Force UCI mode enable\disable rule custom java-script action is not working.

    How do you hide your custom button ? 

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 61

#3
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 53 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans