As you can see in the screenshot below.
When i right clicked on Methods node of table extension there is no option available to add
" New Method ".
So to add a new method in standard table we need to follow the following steps.
- Create an Extension class for table
Right click on your project then Add > New Item > Code > Class > Name "SalesConfirmHeaderMy_Extension" > AddThis class is called "augmentation class" of table "SalesConfirmHeader"
- There are a few rules for augmentation classes outlined by Microsoft
- They must be final.
- They must be suffixed by _Extension
- They must be decorated with the [ExtensionOf()] attribute.
- So first we need to fulfil these rules. Our augmented class will look like below (screenshot)
- Now you can add new methods to the augmentation class.These methods will then appear in intelliSense for variable of the "SalesConfirmHeadrTmp" table.
In my case i added a "myTestMethod()" which sets the value in my custom field
"MyStrField"of that table.
Note : please visit this link to add a new field in standard table using extension approach - Now create a run-able job just to verify that custom added method is displaying in the intellisense or not.
Right click on your project then Add > New Item > Code > Runnable Class (Job) > Name "VerifyMethodJob" > Add - Now create a variable "salesConfirmTable" for table "SalesConfirmHeaderTmp"
and as you can see in the screenshot below that custom added method is displaying in the intellisense which was defined in the augmentation class