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

Notifications

Announcements

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 636
 
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
    636 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard