Monday, October 2, 2023

Call .Net class method in X++ code

You need to create .Net Class Library project if you want to consumen .Net functionality in you X++ project 

then On X++ class define .Net namespace like this


using KAFileFormatting;


then If you method is statis then you can call it like this 



KAFileFormatting.KATest::excelToPDF(memoryStream);


Here KAFileFormatting is the Namespace name of .Net project , KATest is the Class name and excelToPDF is the method name . Method can take multiple parameters.

Note: For Class library project your framework should be less than or equal to the framework of your X++ project. otherwise system cannot identify your namespace of .Net in X++ class.

No comments:

Post a Comment

Change SSRS Report Design Based On Condition , D365 ,X++

 To change Sales Invoice control document's design based on condition use following code. Here I have created COC of salesInvoiceControl...