Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to Enable\Disable Perticular Column in Grid ??

(0) ShareShare
ReportReport
Posted on by 1,010

I want to set Enable/Disable one field of particular row

Like

                     Home        Phone         Travel

              1.    Value11    Value12     Value 13

              2.    Value21    Value22     Value 23

              3.    Value31    Value32     Value 33

              4.    Value41    Value42     Value 43

For example i want to disable Value33 of Row3. for this I write following code in Active method of DataSource.

if(LISPL_ProjectContractTable.Travel== NoYes::No )
{
LISPL_ProjectContractTable_ds.object(fieldNum(LISPL_ProjectContractTable,Travel)).enabled(false);

}

but whenever  i am writing value on one Column it is copying the same value to all column of row.

Kindly Do Help..

*This post is locked for comments

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,371 Most Valuable Professional on at
    RE: How to Enable\Disable Perticular Column in Grid ??

    You can't do it for individual cells. Please read my reply again.

    If your active() method isn't called, you're probably working with a wrong datasource.

  • D.K.S. Profile Picture
    D.K.S. 1,010 on at
    RE: How to Enable\Disable Perticular Column in Grid ??

    Hi Andre, I did the same you told. I kept break point and debugged but active method is not calling on Row Change in Grid.

    how do i can achieve my goal to Enable/Disable Grid of Perticular Cell. ??

  • D.K.S. Profile Picture
    D.K.S. 1,010 on at
    RE: How to Enable\Disable Perticular Column in Grid ??

    Hello Martin,

    So How can i do it for Perticular Cell ? Kindly help.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,371 Most Valuable Professional on at
    RE: How to Enable\Disable Perticular Column in Grid ??

    Of course - it's a property of the column, not of an individual cell. But that's all right, because if users switches to another row, activate() executes again and set the value appropriately based on data in the active row. What's the value of Enabled property for inactive rows is irrelevant, because users can't work with them.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,642 Super User 2024 Season 2 on at
    RE: How to Enable\Disable Perticular Column in Grid ??

    Hi D.K.S,

    The coding is disabling the complete column. You should also have an option to re-enable the field for other records.

    So also add:

    else

    {

    LISPL_ProjectContractTable_ds.object(fieldNum(LISPL_ProjectContractTable,Travel)).enabled(true);

    }

    Or replace the complete logic with:

    LISPL_ProjectContractTable_ds.object(fieldNum(LISPL_ProjectContractTable,Travel)).enabled(LISPL_ProjectContractTable.Travel== NoYes::Yes);

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans