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, ...
Suggested Answer

Help on Event Handler Cutomer Open Invoices Grid Due Date

(0) ShareShare
ReportReport
Posted on by 24

Hi, Im new in FO dev, and I will be very pleased if you guys can help me

anyways

Im trying to create a new field in Customer Open Invoices (settlement grid page ) with the name "Original Due Date" to save the due date when I postpone some Open Invoices payment, which I did using extend custran table and extend CustOpenInvoices Interface adding this field "Original Due Date"

After that Im trying to use FormControl Event Handler on modified event to send the data to the new field

Im using "Info" to show the date, just to know if I getting the due date value

And Im getting error

pastedimage1668189372734v1.png

My Code

/// <summary>
/// Class para customer Open Transactions
/// </summary>
class Eur_CustOpenTran
{

/// <summary>
/// teste
/// </summary>
/// <param name="sender">Tela</param>
/// <param name="e">sera isso</param>
[FormControlEventHandler(formControlStr(CustOpenTrans, CustTransOpen_DueDate), FormControlEventType::Modified)]
public static void CustTransOpen_DueDate_OnModified(FormControl sender, FormControlEventArgs e)
{
FormRun formRun = sender.formRun();
FormRealControl FormControldDueDate = formRun.design().controlName(formControlStr(CustOpenTrans,CustTransOpen_DueDate));
FormControl formControldOrigDate = formRun.design().controlName(formControlStr(CustOpenTrans,CustTrans_Eur_OriginalDueDate));
str dDueDate= strFmt("%1", FormControldDueDate.realValue());
info(dDueDate);
}

}

I have the same question (0)
  • finance Profile Picture
    24 on at

    another question would be how to populate the new field Original Due Date

  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

    You have assigned date control to FormRealControl to get the due date.

    Also please use insert code from rich formatting.

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,843 Moderator on at

    Also for assigning the value to Original due date. First you need to get the CustTrans datasource and from the datasource you can get the current record using cursor method.

    Assign it to a buffer and using that buffer you can assign value to Original due date field from due date field value.

    Also you need to use the "FormDateControl" instead of "FormControl"

    Thanks,

    Girish S.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June 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... 412 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 396

#3
Martin Dráb Profile Picture

Martin Dráb 261 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans