Posts

Assembly reference containing type is not referenced, Object 'CLRObject' could not be created

Image
Problem Statement I have RDP and an AX shortcut icon, I have a parameter form with a "Test Connection" button. Upon clicking this button, a DLL is invoked to authenticate the connection status. This DLL is placed in both the client and server directories: specifically, it is located in the Client Directory at C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin and in the Server Directory at C:\Program Files\Microsoft Dynamics AX\60\Server\<MachineName>\bin . Additionally, a reference to this DLL has been added to the Application Object Tree (AOT) to facilitate its functionality When running the process from RDP, the "Test Connection" passes successfully. However, when using the AX shortcut icon, an error is encountered. Solution Add C# project into AOT, by right click on project and ADD <ProjectName> to AOT. Open project and set the project property. Deploy to client YES and Deploy to server YES and Deploy the project. After deployment of projec...

Open Packing slip posting form when updating Generate picking list

Image
  Functional Process: Creating Picking list registration. After creating a picking list registration, to update the picking list registration click on Update then Handling status becomes Completed . For posting this picking list user clicks on the  Post packing slip. Requirement: On the Update button Post packing slip form should be open.         Post packing slip form is opened on the Update button. Technical Background:     Create CoC of Update button as below: [ExtensionOf(formcontrolstr(WMSPickingRegistration, PickAllButton))] final class ERWMSPickingListRegistration_PickAllButton_Extension {     /// <summary>     /// This method is used to Populate Post packing slip form     /// </summary> void clicked()     {         WMSPickingRoute wmsPickingRoute;         SalesTable      salesTable;         MenuFunction...

How to export bacac file

Image
 Steps: 1. On this navigation click on Export Data-tier Application. Error: Solution: Increase time on Registry Editor and restart the machine.                    Navigation :  Computer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SQLDB\Database Error: After removing this error, repeat same process to export bacpac file and again face another error. Solution: to resolve this error run command on SQL. update sysglobalconfiguration set value = 'SQLAZURE' where name = 'BACKENDDB' update sysglobalconfiguration set value = 1 where name = 'TEMPTABLEINAXDB' drop procedure if exists XU_DisableEnableNonClusteredIndexes drop procedure if exists SP_ConfigureTablesForChangeTracking drop procedure if exists SP_ConfigureTablesForChangeTracking_V2 drop schema [NT AUTHORITY\NETWORK SERVICE] drop user [NT AUTHORITY\NETWORK SERVICE] drop user axdbadmin drop user axdeployuser drop user axmrruntimeuser drop user axretaildatasyncuser...

Import bacpac file

Image
  Steps: Note : Take a backup before importing .bacpac file. 1. Download SQL package from this URL (https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/database/dbmovement-scenario-exportuat) 2: Go to SQL package folder  3: Open CMD as administrator and go to SQL package directory 4: Run command (SqlPackage.exe /a:import /sf:C:\Users\Adminab1850da5a\Downloads\11012023\SZY-UATbackup.bacpac /tsn:localhost /tdn:AXDB_UAT /p:CommandTimeout=9999 /TargetEncryptConnection:false) 5: In this command give bacpac file directory path and give database name 6: Once bacpac file restore. Stops services (word wide web, Microsoft Unified, Data Import Export, Batch Mangement) and rename the database. 7: After restoring DB synchronization DB. 8: Run admin provisioning tool(k:AosService/PackagesLocalDirectory/Bin)

Send E-mail using SysMailer class

 * Send simple paragrapgh or message using Email Template static void ProjectAssignmentEmailUsingSysMalier(Args _args) {     SysEmailParameters      parameters;     SMTPRelayServerName     relayServer;     SMTPPortNumber          portNumber;     Str1260                 subject, body;     SysMailer               mailer;     System.Exception        e;     SysEmailTable           sysEmailTable;     SysEmailMessageTable    message;     HcmWorker               worker;     ProjTable               projTable;     SysEmailId              sysEmailId;     Map...

Send E-mail using SysEmailTable::sendEmail() method

 * Send simple paragrapgh or message using Email Template  * SysEmailTable is a table and sendMail() is a method static void ProjectAssignmentEmailUsingSysEmailTable(Args _args) {     SysEmailId sysEmailId;     Map mappings;     str recepient;     HcmWorker worker;     ProjTable projTable;     worker = HcmWorker::find(5637183005);     projTable = projTable::find('6805');     sysEmailId = 'Custom';     if (worker && projTable)     {             recepient = worker.email();             mappings = new Map(Types::String,Types::String);             mappings.insert('WorkerName', worker.name()); // this will replace variable with actual value.             mappings.insert('ProjectId', projTable.ProjId);             mappings.insert('...

Send email using .Net framework

Image
This code will send email using .Net Framework. Create email template:      Goto : Organization adminstration > Setup > E-mail templates. Create E-mail template give E-mail ID, E-mail description, Default language, Sender name, Sender e-mail. set the email body of above-created record. Goto: E-mail message and set e-mail body as below. static void SendEmployeesDataInEmail(Args _args) {     System.Net.Mail.MailMessage    mailMessage;     System.Net.Mail.SmtpClient     smtpClient;     SystemParameters               systemParameters;     Email                          emailFrom, emailTo;     SysEmailMessageTable           message;     SysEmailId                     sysEmailId;     Employee...