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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Disable header/lines from

(1) ShareShare
ReportReport
Posted on by 756
Hi All,
 
I need to add a checkbox to the counting journal. When this checkbox is selected, both the headers and lines of the form records should become uneditable. I'm open to suggestions for implementing this feature, whether through the Chain of Command (COC) or any other solution.
 
Thanks
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,362 Super User 2025 Season 2 on at
    Disable header/lines from
    Hi @Hisham
     
    you can add a COC method to the form so that you can apply the business logic :
     
    e.g
     
    public void init()
    {
        Param  param = Param::find();
        next init();
    
        yourdatasource_ds.AllowEdit(param.CheckBox);
    }
     Best regards,
    Mohamed Amine Mahmoudi
  • Suggested answer
    Layan Jwei Profile Picture
    8,058 Super User 2025 Season 2 on at
    Disable header/lines from
    Hi Hisham,

    On the modified method of the this tickBox, if this box is true, then disable everything.
    Also on the init method of the form, you should add the same logic, so that it works when you first open the form if the flag is already true.

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • André Arnaud de Calavon Profile Picture
    299,956 Super User 2025 Season 2 on at
    Disable header/lines from
    Hi Hisham,
     
    Can you explain more about the business requirements? Why do you need a checkbox and what do you need to achieve? What is the exact purpose? Will this checkbox be a field part of a table? Is the checkbox editable by all users?
    It is quite easy to just add a checkbox and influence the properties of the data sources. In case one person should be set e.g. a flag per journal to report it as ready where other users shouldn't be able to undo this flag, then you would need to implement it in a different way.
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    Disable header/lines from
    Hi,
    Can you explain your specific use case, or what purpose do you need to use the checkbox? If all users can click the checkbox, it is not reasonable to click the checkbox to disable the record, because the checkbox does not have the ability to restrict behavior for each user. Or is it only the administrator who has permission to click on this checkbox to restrict the behavior of some/all users?
    Best regards,
    Kevin
  • Suggested answer
    Waed Ayyad Profile Picture
    8,984 Super User 2025 Season 2 on at
    Disable header/lines from
    Hi Hisham,
     
    You can add the checkbox to form using Extension but does this checkbox will be bound to data source? 
    You can add your code on the modified method of the check box and if you want to check the checkbox value when you open the form you should put your code on the init method of the form also.
     
     
    Thanks,
    Waed Ayyad
  • Suggested answer
    Deepak Agarwal Profile Picture
    8,585 on at
    Disable header/lines from
    You need to share more details on business requirements, adding a check box won't solve this as that checkbox will also be controlled by this customization. I wouls rather suggest to explore user roles to achieve this. 
  • Suggested answer
    Hisham Alsayed Profile Picture
    756 on at
    Disable header/lines from

    Hi everyone,

    Thank you for your responses. I'd like to provide further clarification on the requirement, as the suggested solutions may not be applicable in the current scenario.

    The requirement entails adding a checkbox in the header form of the Counting journal to disable both the header and details sections. This disabling should occur when updates are made from an external system through integration, rather than by end users.

    I have implemented my current code in the Active DataSource method using the Chain of Command (COC) approach.

     
    [ExtensionOf(formDatasourceStr(InventJournalCount, InventJournalTable))]
    final class VEL_InventJournalCount_DS_Active_Extension
    {
    if(inventJournalTable.VEL_WriteInProgress == NoYes::Yes)
            {   this.allowEdit(false);
                InventJournalTrans_ds.allowEdit(false);
                InventDim_ds.allowEdit(false); 
    }
    else
    {
                this.allowEdit(true); 
                InventJournalTrans_ds.allowEdit(true);
                InventDim_ds.allowEdit(true); 
    }
     
    }
     
     

    However, the current approach faces challenges due to specific methods in the Counting Journal form, such as "InitBlock," which maintain the form's enablement unless specific restrictions like "block by user" or "block by system" are applied.

    Considering this, I am contemplating updating the "block by system" field in the database to restrict the DataSources for this form. However, this approach deviates from system standardization, especially if the form remains enabled when the customized checkbox is checked.

    Therefore, I am considering an alternative solution: preserving the value of "block by system" in another field until the process is completed. Subsequently, I will uncheck the customized checkbox to restore the "block by system" to its original value before the update.

    This approach aims to ensure adherence to system standards while effectively managing the form's enablement based on the requirements.

    Please let me know if you have any other suggestions.

     
    Kind Regards,
    H
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Disable header/lines from
    In that case, is it not possible to write coc post next of this init block and use your custom fields only?
  • Hisham Alsayed Profile Picture
    756 on at
    Disable header/lines from
    Hi Bharani,
     
       Thanks for your reply, could you please provide more insights or detailed suggestions.
     
    Kind Regards,
    H
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Disable header/lines from
    However, the current approach faces challenges due to specific methods in the Counting Journal form, such as "InitBlock," which maintain the form's enablement unless specific restrictions like "block by user" or "block by system" are applied.
     
    When you say the above, then you can use the same method and write a coc post next. Let's say if in this init block total disablement is maintained from standard, then post next you can use custom code for modifying it again.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 684 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 588

#3
Martin Dráb Profile Picture

Martin Dráb 542 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans