Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to get value on FormDataSourceEventType::Initialized method

Posted on by 560

Hi All,

I use  FormDataSourceEventType::Initialized  on HcmPosition .In this am not get any value below code .

Please give any idea to get value  using below code.

 [FormDataSourceEventHandler(formDataSourceStr(HcmPosition, HcmPositionDuration), FormDataSourceEventType::Initialized)]
    public static void HcmPositionDuration_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
    {
        FormControl                    Position;
        HcmPositionWorkerAssignment    hcmPositionWorkerAssignment;
        HcmPositionWorkerAssignmentEndDate enddate;
        FormRun                     element                     = sender.formRun();
        FormDataSource              hcmPositionDuration_ds      = element.dataSource(formDataSourceStr(HcmPosition, HcmPositionDuration)) as FormDataSource;
        HcmPositionDuration         hcmPositionDuration         = hcmPositionDuration_ds.cursor();     
       
     
        Info(strFmt("%1",HcmPositionDuration.Position));

}

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to get value on FormDataSourceEventType::Initialized method

    If you want to work with current record you need to work with "active" method. It gets triggered when record is selected. Also you can use CoC instead of events, here is docs article about CoC docs.microsoft.com/.../method-wrapping-coc it shows how to use with init() but you should get a point

  • Suggested answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: How to get value on FormDataSourceEventType::Initialized method

    Hi Tony,

    Initialized event is used during the initial initialization of data source and for example, you can apply additional ranges here.

    In your case, you need to use OnInitValue event.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans