HOW TO CREATE AN EXTENSION IN D365 ON TABLES.
- 1 Create a new project.
- 2. Make sure the project has the models attached to it.i.e the tables model name.
- 3. right click on any table and select create extension.
- 4.
- 5. This will create an table with tablename.extension
- 6. you can add any fields over here i.e table level customization.
- 7. IF you want to add any method then you will have to create a class for the same
- 8. below is an example.
[ExtensionOf(tableStr(CustTable))]
final class CustTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
//This attribute will cache your method.
public static display Name
myDisplayName(CustTable _this)
{
return _this.nameAlias() +
"myDisplayName";
}
}
9 You can add as many methods as you want over
here .
1 The existing methods needs to be properly added with
the signature methods and then modified as shown below.
[FormDataSourceEventHandler(formDataSourceStr(PriceDiscAdm,
PriceDiscAdmTrans), FormDataSourceEventType::Activated)]
public static void PriceDiscAdmTrans_OnActivated(FormDataSource sender,
FormDataSourceEventArgs e)
{
FormRun caller =
sender.formRun();
PriceDiscAdmTrans priceDiscAdmTrans = sender.cursor();
FormControl priceDecimals =
caller.design().controlName('controlname');
boolean editcontol = true;
priceDecimals.enabled(editcontol);
}
Hello, an amazing Information dude. Thanks for sharing this nice information with us. Curso Oficial Elearning Homologado para la Certificación ITIL® Foundation V 4(Contenidos oficiales desarrollados por Nanfor Ibérica)
ReplyDelete