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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How will get the form active record in CoC

(0) ShareShare
ReportReport
Posted on by 474
Hi team,
 
Is it possible to get the form current record in CoC extension class.
 
Suppose in the form I have 10 records.
 
If put the cursor on 5th record, the CoC class extension should return 5th record only.
 
Is it possible? Pls advise.
 
thanks!
Categories:
I have the same question (0)
  • Suggested answer
    Subra Profile Picture
    1,598 on at
    Hi @CU10121822-0

    Yes, we can get the form current record using cursor method in coc classes.

    Kindly let me know if you have any issues.
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • CU10121822-0 Profile Picture
    474 on at
    Thanks Subra, 
     
    Could you provide mr the code sample. thanks!
  • Subra Profile Picture
    1,598 on at
    Hi @CU10121822-0

    Yes, Could you please tell me which method you have created a COC?

    Thanks,
    Subra
  • CU10121822-0 Profile Picture
    474 on at
    Form  CustTable - init method 
  • Verified answer
    Subra Profile Picture
    1,598 on at
    Please use the below code to get the form datasource current buffer.

    FormRun formRun = this as FormRun;
    FormDataSource salesTable_ds = formRun.datasource(formDataSourceStr(CustTable, CustTable));

    custtable custTable = custtable_ds.cursor();
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • CU10121822-0 Profile Picture
    474 on at
    Thanks Subra, your code should only contained custTable not the sales table. 
  • Subra Profile Picture
    1,598 on at
    Hi @CU10121822-0

    Thanks for correcting me

    Typo mistake and I have corrected now.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 545 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 495

#3
Shaluma Profile Picture

Shaluma 321

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans