subform check

Hi all!!!


can someone please suggest me that how can i add serial no. in  a subform that i have developed in Nav 13.

also it shall be incremented with every new line no.


I also have the item no. in header as well as subform and i want a validation that the header and subform item no should be same else it should give an error.