Customize : Restrict Session Date to Use Future Date AX 2012

Session date can help user to change the date for the current client session. The following list provides examples of some processes or areas of Microsoft Dynamics AX that are affected when you change the client session date:

  • The posting date in all modules
  • The invoice date and associated due date
  • The statistics period in which the current transaction is updated

But, session date for future date it can be a blunder for data posting. For example now we are in date Feb 22, 2017 and we can create posting inventory journal for a month after or a year after by change the session date. Therefore, wee need to restrict session date to change into future date.

To access session date, you can use this navigation :  Click File > Tools > Session date and time or you can access from this menu :

sesdatemenu

This is session date form :

sesdateform

You can add a coding in form above to restrict date from future date in method validate like in picture below.

sesdatedesign

This is full coding of method validate :

boolean validate()
{
 boolean ok;
 ;

 ok = super();

 if (ok && !this.dateValue())
 return checkFailed("@SYS24455");

 //Custom Begin
 if (ok && this.dateValue() > today())
 return checkFailed("No future date posting.");
 //Custom end

 return ok;
}

If all custom was finished, let’s try to change session date a mont after,

sesdateinfo

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: