Kindly follow the solution below:
- Navigate to Customization > Lists, Records, & Fields > Transaction Line Fields > New
- Label: Enter Label
- Type: Select Integer Number
- Store Value: Remove Checkmark
- Click Applies To
- Desired transaction: Enter Checkmark
- Click Validation & Defaulting
- Formula: Enter Checkmark
- Default Value: Enter MONTHS_BETWEEN({custfield2}, {custfield1})
- Click Save
Note: custfield2 and custfield1 are the Expiration date and Manufacturing date, respectively.