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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to disable a timel...
Power Apps
Unanswered

How to disable a timeline control on Form Load event

(1) ShareShare
ReportReport
Posted on by 672
 
We had an issue during testing, when a custom activity record  was accidently added to an inactive parent record.  On the FormLoad event, I thought I would disable the Timeline control  if the parent record statecode = 1.  Well that was the theory! According to the docs:
 
 
 
I have updated @types/xrm but I don't think this the issue, nor do I think the setDisabled() method is available in the other controls.  So what is missing?
 
Unfortunately, my attempt to circumvent the type restrictions appears to work but has no impact on the Timeline. 
 
 
    
        let myStandardControl = formContext.getControl<Xrm.Controls.StandardControl >("Opendays");
    
        if (myStandardControl != null)
        {
            alert("found control");
            // disable the control
            myStandardControl.setDisabled(true);

            alert("disabled control " + myStandardControl.getDisabled());
        }
        
 
I have the same question (0)
  • westerdaled Profile Picture
    672 on at
    It looks like the inaccurate documentation may be the issue for Timelines ( see previous post).
     
    This snippet works like a charm tho none too popular!
    
          if (!allowExpensesOptionSetCOntrol.getDisabled() && allowExpensesOptionSetField?.getText() == "No")
          {
            console.log("Locking expense claims because there isn't the budget!");
            allowExpensesOptionSetCOntrol.setDisabled(true);
          }    
    
     
     
     

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 915

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 457

Last 30 days Overall leaderboard