Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

how to COC or eventhandler displayOption method in form dataSource table

(0) ShareShare
ReportReport
Posted on by 46

how to override displayoption method on form datasource throw extension using coc or eventhandler

can any one help me and give an example please as i used the following code and its not working

[ExtensionOf(formDataSourceStr(SalesTable, SalesLine))]
internal final class NAQLA_SalesTableFormSalesLineDS_Extension
{

public void displayOption(Common _record, FormRowDisplayOption _options)
{
#define.color(0,191,255)

if(_record.(fieldNum(SalesLine,ItemId) == 'A0001')
{
_options.backColor(WinAPI::RGB2int(#color));
_options.affectedElementsByField(fieldNum(SalesLine,SalesId));
}

next displayOption(_record, _options);

}

}

  • OmarAbdlhamed Profile Picture
    OmarAbdlhamed 46 on at
    RE: how to COC or eventhandler displayOption method in form dataSource table

    Thanks guys i think it will help me

  • Verified answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: how to COC or eventhandler displayOption method in form dataSource table

    Please check this link.

    www.theaxapta.com/.../set-background-color-for-field-in-form.html

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: how to COC or eventhandler displayOption method in form dataSource table

    Hi OmarAbdlhamed,

    Please check the sample code of customization for adding color to a form control of a standard or custom form by using event OnDisplayOptionInitialize.

    allaboutdynamic.com/.../

    community.dynamics.com/.../override-displayoptions-method-of-a-datasource-in-extensions-in-ax7

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans