Announcements
No record found.
I have added one check box in my form and if i tick that check box there are two fields on another form that must be disable and if i enable how can i get this done .
should i have to use chain of comand or i go with event handler of that checkbox. plz guide me on this.
Hi Dinesh,
It's up to you - You can use either COC or Event handler. COC will be better option as you will have access to form variables and DataSource current records easily.
Thanks,
Girish S.
I have extended table added enum field which i dragged in form but not getting which method i should use after the extension
[ExtensionOf(tableStr(LedgerJournalTrans))] final class dtGeneralLedgerChKBx_Extension { }
Correct me if I am wrong - You have created one Enum field in standard table using extension and add that to design part of the form also using extension.
Now based on the Enum field you need to enable disable the fields. Is that you are asking?
If yes you can write COC for modified method of the Enum field control at DataSource level.
Refer to the below blog for how to write modified method on DataSource field using COC.
https://dynamics365musings.com/chain-of-command-form-datasource-field/
Hi Dinesh, Please check this old thread and find last comment from Martin
community.dynamics.com/.../enable-disable-field-based-on-enum-noyes
You can use CoC or Event handler to extend modified method for formDataSource enum field.
Check this article for CoC for FormDatasource
dynamics365musings.com/.../
Girish has already shared article fof CoC on Datasource field level. You can use any one of it, either extend form Control or Datasource field, both should work.
thanks for reply ,
GirishS,
mohit rampal,
I have, the made the code, but little issue i am having here what i have to do is when i click on this check box this form is link with another dialog form so if i tick on this check box the two field on the dialogue form should be disable or non editable and if uncheck /untick this fields should will be enable or editable so how can i call another dialogue form data source in my code can you plz guide me on this .
[ExtensionOf(formDataFieldStr(LedgerJournalTransDaily,LedgerJournalTrans,ATLoss))] final class dtGeneralLedgerChKBx_Extension { public void modified() { FormDataObject formDataObject = any2Object(this) as FormDataObject; FormDataSource formDataSource = formDataObject.datasource(); LedgerJournalTrans ledgerJournalTrans; next modified(); ledgerJournalTrans = formDataSource.cursor(); if(ledgerJournalTrans.ATLoss==NoYes::Yes) { TransTaxInformation_ds.object(fieldNum(TransTaxInformation, HSNCodeTable).allowEdit(false)); TransTaxInformation_ds.object(fieldNum(TransTaxInformation, ServiceAccountingCode_IN).allowEdit(false)); } else { TransTaxInformation_ds.object(fieldNum(TransTaxInformation, HSNCodeTable).allowEdit(true)); TransTaxInformation_ds.object(fieldNum(TransTaxInformation, ServiceAccountingCode_IN).allowEdit(true)); } } }
You need to get the caller record on the second form using element.args().record() - From the caller record you can get the Enum field value and based on that you can enable disable the fields.
If I understood correctly, the checkbox ATLoss is add in LedgerJournalTransDaily Form. The value of this checkbox will control fields in Dialog form so you need to acccess the checkbox value in the Disalog form. If its a Dialog form, in the init method of form, you can get LedgerJournalTrans table buffer by calling element.args().record(). Then you can control Dialog form fields.
In case, its a Dialog class then you can write it in Main method but don't use keyword element.
thanks for reply
Mohit Rampal ,
Girishs,
the 2nd form pattern is dialogue basic , its data is coming from transtaxinformation table i tried the init method but its giving me errors you guys have any example so i can modify my code like that i tried this link but not getting how to do it https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/487749/passing-values-to-dialog#:~:text=You%20need%20to%20pass%20the%20caller%20record%20of,same%20buffer%20while%20calling%20the%20second%20dialog%20form.
thank you.
You need to create new class for form extension. Try the below code and see if it works.
[ExtensionOf(formStr(formName))] Internal final class FormName_Extension { //initialize buffer for caller table name. LedgerJOurnalTable journalTable; public void init() { next init(); journalTable = this.args().record(); } //create one new method for retreiving the caller record. Public LedgerJOurnalTable getJournalTable() { return journalTable; } }
Modified method for second form.
[ExtensionOf(formDataFieldStr(FormName, TableName, FieldName))] final class DataSourceName_FieldName_Extension { public void modified() { next modified(); LedgerJOurnalTable journalTable; journalTable = element.getJOurnalTable(); //add code to enable disable field. FormDataSource fds = element.datasource(formDatasourcestr(FormName, DatasoruceName)); fds.object(fieldnum(TableName, FieldName).allowedit(false)); } }
If dialog form is custom and not standard then you can access objects, variables, datasource directly within form. No need to use extensions.
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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 509 Super User 2026 Season 1
Giorgio Bonacorsi 375
Adis 268 Super User 2026 Season 1