Add Serial number field to any table and increment that according to Different Name

Code:

public void modifiedField(FieldId _fieldId)
{
FormLetterRemarks formLetterRemarks;
super(_fieldId);
select count(FormLetter) from formLetterRemarks where formLetterRemarks.FormLetter == this.FormLetter;
if(formLetterRemarks.FormLetter == 0)
{
this.Seq_Number = 1;
}
else
{
this.Seq_Number = formLetterRemarks.FormLetter + 1;
}
}

OUTPUT

  • For Packing Slip it starts from 1
  • For Invoice also it starts from 1

Sequence

Advertisements

2 comments on “Add Serial number field to any table and increment that according to Different Name

  1. Pingback: Add Serial number field to any table and increment that according to Different Name - Microsoft Dynamics AX Community

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