Posts

Showing posts from June, 2023

X++ code to create and post Inventory Adjustment Journal By Posting Packing Slip From Sales Order

  Following is the sample job to show how we can create and post  Adjustment  journal by x++ To  Create and Post Journal From Sales Packing Slip ,Create a COC for class  SalesFormLetter_PackingSlip  and use Run method . [ExtensionOf(classStr(SalesFormLetter_PackingSlip))] final class Inventoryadjustmentjournal_Extension {       public void  run()     {         next run();                 CustPackingSlipJour  custPackingSlipJour;         custPackingSlipJour = this.parmJournalRecord();         InventjournalHelper::invAdjJour(CustPackingSlipJour);     } } Creating Helper Class  for creation of  Header and Line creation  and passing helper class method in COC. public class InventjournalHelper {        public static void invAdjJour(CustPackingSlipJour custPackingSlipJour)    ...

MultiThreading using SysOperationFrameWork

  Requirement    Develop batch job (Sysoperation Framework, with multi threading) to cleanup older or historical transactions.  UI  transaction cleanup  Technical  CleanupScheduler CleanupTask Dialog Messages older than (In Days)  = 90 Number of tasks Scheduler Finds records from custom table that are older than 90 days and assign to tasks Tasks will just delete the record Provide info log on how many records cleaned up we should create six classes for multithreading by using sysoperation frameworks  1)CleanupSchedulerContract 2)CleanupSchedulerController 3)CleanupSchedulerService 4)CleanupTaskContract 5)CleanupTaskController 6)CleanupTaskService 1)CleanupSchedulerContract [DataContractAttribute] [SysOperationAlwaysInitializeAttribute] class CleanupSchedulerContract implements SysOperationInitializable {     Integer numOfTask,numOfDays;     [DataMemberAttribute,         SysOperationLabel(literalStr("Old...

Steps to fix expired certificate in d365 f&o

  Here’s how to fix it You have to issue a new self-signed certificate for *.cloud.onebox.dynamics.com and change the web site binding settings to use it. Step 1: Create a new self-signed certificate Run the following Power Shell command (Run as Administrator): New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\My -DnsName *.cloud.onebox.dynamics.com -KeyUsage EncipherOnly, CRLSign, CertSign, KeyAgreement, DataEncipherment, KeyEncipherment, NonRepudiation, DigitalSignature, DecipherOnly -NotAfter (Get-Date).AddMonths(60) This would create a new certificate, which has been set to expire in 60 months:   For creating self-signed certificates, you can also use  this free Self-Signed Certificate Generator . Step 2: Copy the new certificate to the folder where trusted certificates are stored Open Manage computer certificates (certlm). Newly generated certificate can be found in Personal\Certificates folder. It has the same name as the old one, but different expirat...

Import and Export models/Projects using Command Prompt

  Note :- Command prompt must be open in admin mode. C:\AOSService\PackagesLocalDirectory\bin>(Common path) change model name accordingly Run the below mentioned command to Import/Export models   Import :-  ModelUtil.exe -import -metadatastorepath=[path of the metadata store where model should be imported] -file=[full path of the file to import] Ex:-  C:\AOSService\PackagesLocalDirectory\bin>ModelUtil.exe -import -metadatastorepath=C:\AOSService\PackagesLocalDirectory -file=C:\Users\Administrator\Desktop\BASOFAMicroServices-BASOFA.axmodel Export:-  ModelUtil.exe -export -metadatastorepath=[path of the metadata store] -modelname=[name of the model to export] -outputpath=[path of the folder where the model file should be saved] Ex :-  C:\AOSService\PackagesLocalDirectory\bin>ModelUtil.exe -export -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname="BASOFAMicroServices" -outputpath=C:\Users\Administrator\Desktop

X++ code to create and process a purchase order

  class POCreationJob {     /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         //Data entity declaration         PurchPurchaseOrderHeaderV2Entity  purchTable;         PurchPurchaseOrderLineV2Entity    purchLine;         //Create Purchase header         purchTable.initValue();         purchTable.OrderVendorAccountNumber    = "001101";         purchTable.insert();         //Fetching PurchId to create lines         PurchId purchid = purchTable.PurchaseOrderNumber;         //Create Purchase lines         purchLine...

X++ code to create and process a sales order

  class BASSalesOrderCreationJob {     /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         //Declaration of data entities          SalesOrderHeaderV2Entity salesTable;         SalesOrderLineV2Entity salesLine;         //Sales order header creation         salesTable.initValue();         salesTable.OrderingCustomerAccountNumber = "004056";         salesTable.insert();         //Getting saleId to create lines          SalesId salesId = salesTable.SalesOrderNumber;         //Sales order line creation         salesLine.initValue(...

X++ code to create purchase order for a sale order if physical inventory is not available for a particular sale order

  class BASPurchOrderForSaleOrderJob {     /// <summary>     /// Runs the class with the specified arguments.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         //SalesId which I want to create Purchse Order         SalesId salesId = "014754";         int countLines;         SalesLine salesLine;         InventDim inventDim;         InventSum inventSum;         //Checkung On hand inventory          while select SalesId,ItemId from salesLine             where salesLine.SalesId == salesId             join InventSiteId,InventLocationId from inventDim             where i...