Posts

Showing posts from November, 2025

Get CustInvoiceTable in D365fo x++

  Get  CustInvoiceTable  in D365fo x++ CustInvoiceTable custInvoiceTableV2(CustInvoiceJour _custInvoiceJour) { CustInvoiceTable custInvoiceTable; select firstonly custInvoiceTable where custInvoiceTable.RecId == str2int64(subStr(_custInvoiceJour.InvoiceId, 2, strLen(_custInvoiceJour.InvoiceId))); return custInvoiceTable; }

List Panel to the form d365fo x++

Image
List Panel  to the form  d365fo x++ class DSNotificationBookmarkMethodListPanel extends SysListPanel { DSNotificationWordBookmark notificationWordBookmark; public void addData(container data) { // The bookmark field is updated at positionUpdated() method. No extra action needed here. } public void removeData(container data) { // The bookmark field is updated at positionUpdated() method. No extra action needed here. } public container getData() { container selectedData, availableData, dataItem; LabelString bookmark; availableData = this.getAvailableAllV2(); // fill in the selected list and remove the items from the available list at the same time container bookmarksContainer = notificationWordBookmark.bookmarks; for (int idx = 1; idx <= conLen(bookmarksContainer); idx++) { bookmark = conpeek(conpeek(bookmarksContainer,...

Add eneity to the form d365fo x++

Add eneity to the form d365fo x++ public void init() { FormRun formRun = this as FormRun; if(formRun) { OfficeFormRunHelper officeHelper = formRun.officeHelper(); if(officeHelper) { officeHelper.OfficeMenuInitializing += eventhandler (this.officeMenuInitializingHandler); } } super(); } public void officeMenuInitializingHandler(FormRun _formRun, OfficeMenuEventArgs _eventArgs) { // Add an entity to the list OfficeMenuDataEntityOptions entityOptions = OfficeMenuDataEntityOptions::construct(tableStr(DSPEmployeeOvertimeJournalEntity)); _eventArgs.menuOptions().dataEntityOptions().addEnd(entityOptions); }

SFTP Connenction manager d365fo x++

SFTP Connenction manager d365fo x++ using System.IO; using System.Collections; using Renci.SshNet; using Renci.SshNet.Sftp; //RESCP.ssh class DSAPSFTPConnectionManager { /// <summary> /// Test SFTP connection /// </summary> public static boolean testConnection(DSAPSFTPProfiles _profile) { boolean isConnected = false; System.Exception ex; DSAPSFTPProfiles profileUpdate; try { SftpClient sftp = new SftpClient( _profile.HostName, _profile.Port, _profile.UserName, _profile.Password ); sftp.Connect(); if (sftp.IsConnected) { info(strFmt("SFTP Authentication successful to %1:%2", _profile.HostName, _profile.Port)); isConnected = true; // Update connection status using a separate select forupdate ttsbegin; s...

CAR Report d365fo x++

  CAR Report  d365fo x++ Code: CD c:\AosService\PackagesLocalDirectory\bin xppbp.exe -metadata=C:\AOSService\PackagesLocalDirectory -all -model="DSProperty" -xmlLog=C:\Temp\BPCheckLog_DSProperty.xml -module="DSProperty" -car=C:\Temp\DSPropertyCAReport.xlsx

How to get military time d365fo x++

How to get military time  d365fo x++ Code: utcdatetime userDateTime = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone()); int hour = DateTimeUtil::hour(userDateTime); int hourLen = strLen(int2Str(hour)); str hourStr = hourLen == 1 ? strFmt("0%1", hour) : strFmt("%1", hour); int Min = DateTimeUtil::minute(userDateTime); int MinLen = strLen(int2Str(Min)); str MinStr = MinLen == 1 ? strFmt("0%1", Min) : strFmt("%1", Min);

Mail Util d365fo x++

Mail Util d365fo x++ Code: public class DSPMMailUtil { str emailBody, emailSubject; List emailToList; List emailCCList; System.IO.Stream fileStream; Filename fileName; SysMailerMessageBuilder messageBuilder; str message; str template; boolean sendInteractive = false; str emailFrom = SysEmailParameters::find().SMTPUserName; Common common; public static DSPMMailUtil construct() { return new DSPMMailUtil(); } public str parmTemplate(str _template = template) { template = _template; return template; } public Common parmCommon(Common _common = common) { common = _common; return common; } public str parmMessage(str _message = message) { message = _message; return Message; ...