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 :
Finance | Project Operations, Human Resources, ...
Unanswered

How to make an itemization date filter control non-editable in TrvExpensesForm

(0) ShareShare
ReportReport
Posted on by 72
Hi,
I have a requirement to make itemization date filter control non-editable (control name - TrvItemizationCalendarControl) on TrvExpenses form. 
I wrote code on form & datasources (TrvExpTrans_ItemizedLines & trvExptrans) as well in init method but still field is editable.
Also, currently when we click on a particular date on calender , based on transaction date records gets filtered in itemization tab but after making this calender non-editable, I want to take the transaction date directly from header & show the transactions directly there based on selected date.
Anyone have idea where to write code to achieve this.
 
 
[ExtensionOf(formDataSourceStr(TrvExpenses,TrvExpTrans))]final class SAPTrvExpenses_Extension{public void init()    {        FormControl trvExpCalender = this.formRun().design().controlName(formControlStr(TrvExpenses,TrvItemizationCalendarControl));        next init();        trvExpCalender.allowEdit(false);        }}
 
Thanks,
Rahul
I have the same question (0)
  • Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at
    First of all, let me re-post your code to make it easier to read:
    [ExtensionOf(formDataSourceStr(TrvExpenses, TrvExpTrans))]
    final class SAPTrvExpenses_Extension
    {
        public void init()
        {
            FormControl trvExpCalender = this.formRun().design().controlName(formControlStr(TrvExpenses, TrvItemizationCalendarControl));
            next init();
            trvExpCalender.allowEdit(false);
        }
    }
    Note that you can do it in a much easier way:
    [ExtensionOf(formStr(TrvExpenses))]
    final class SAPTrvExpenses_Extension
    {
        public void init()
        {
            next init();
            
            TrvItemizationCalendarControl.allowEdit(false);
        }
    }
    Check out if moving your code at the end of form initialization doesn't make a difference. If not, I don't know what's going on. An explanation would be a piece code setting AllowEdit back to true, but I didn't find any. Check out if you don't have such a customization.
     
    Note I didn't test the behaviour, therefore I don't know whether it works the same in my environment.

    Can you please test whether Itemization date filter controls respect AllowEdit property at all?

     
     
  • Rahul Dahiya Profile Picture
    72 on at
    Hi Martin,
    I tried the way you suggested but still field is editable. Visible property is working but allowEdit or enabled is not working on this control.
    Also I tried taking extension of the form TrvExpenses & changed that control allowEdit property to no but still calender is editable.
     
    Thanks,
    Rahul
  • Rahul Dahiya Profile Picture
    72 on at
    Hi Martin,
    I just checked again, by setting enabled property to false. after this, if we are clicking on calender date then nothing is happening before that transaction for a particular date was filtered. But still that control is not greyed out, we are able to click on the dates but only day & date is changing where marked in below image. but I need this control to be greyed out.
     
     
    Thanks,
    Rahul

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 558 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 402

#3
Diego Mancassola Profile Picture

Diego Mancassola 261

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans