Posts

Managers should be able to approve the Movement Journal through the Mobile App APIs

Managers should be able to approve the Movement Journal through the Mobile App   APIs class MK_InventJournalWFApprovalService { public MK_InventJournalWFApprovalResponse InventJournalTablePendingCount(MK_InventJournalRequest _request) { MK_InventJournalWFApprovalResponse response = new MK_InventJournalWFApprovalResponse(); List InventJournalList = new List(Types::Class); if (_request.parmEmail()) { UserId userId = this.getUserInfo(_request.parmEmail()).Id; InventJournalTable InventJournalTable; WorkflowWorkItemTable workFlowItemTable; select crosscompany count(RecId) from InventJournalTable join workFlowItemTable where workFlowItemTable.RefRecId == InventJournalTable.Recid && InventJournalTable.JournalType == InventJournalType::Movement && InventJournalTable.WorkflowApprovalStatus == InventJournalWorkfl...

Get enum values in D365fo x++

Get enum values  in D365fo x++ static void GetEnumValue(Args _args) { int EnumValue = enum2Int(PurchStatus::Invoiced); //Replace Base enum info(strfmt(“%1 EnumValue”, EnumValue)); } SQL Query: select t1.NAME,t2.ENUMID,t2.ENUMVALUE,t2.NAME EnumValueName from ENUMIDTABLE t1 join ENUMVALUETABLE t2 on t1.ID=t2.ENUMID where t1.NAME = 'AttributeDataType'

Project invoice transactions in D365fo x++

 Project invoice transactions   in D365fo x++ /// <summary> /// Service Contract Invoice Details Report /// Hassan Farooq - 29 Aug, 2025 /// The DP class of the report /// </summary> [ SRSReportParameterAttribute(classStr(MK_RevenueReportContract)) ] public class MK_RevenueReportDP extends SrsReportDataProviderPreProcessTempDB { MK_RevenueReportTmp tmpTable; [ SRSReportDataSet('MK_RevenueReportTmp') ] public MK_RevenueReportTmp gettmpTable() { select tmpTable; return tmpTable; } public void processReport() { ProjProposalJour projProposalJour; MK_DefaultDimensionView defaultDimensionView; MK_LedgerDimensionCostCenter ledgerDimCostCenter; MK_RevenueReportContract contract = this.parmDataContract(); TransDate fromDate = contract.parmFromDate(); TransDate toDate = contract.parmToDate(); List v...

Conditionally making your menu items visible on main menu, in D365fo x++

  Conditionally making your menu items visible on main menu,  in D365fo x++ a. Create a new class USMenuItemsVisibilityManager b. Copy the following method, with proper documentation (don't change signature/anything else) [SubscribesTo(classstr(SysMenuNavigationObjectFactory), staticdelegatestr(SysMenuNavigationObjectFactory, checkAddSubMenuDelegate)), Hookable(false)]     internal static void menuItemVisibilityHandler(SysDictMenu _rootMenu, SysDictMenu _subMenu, SysBoxedBoolean _subMenuVisibility) c. And then just introduce the following code in the method: if (_subMenu.isMenuItem())         {             var metaElement = _subMenu.GetMenuItemMetaElement();             if (metaElement != null)             {                 vendParameters parmTable =  VendParameters::find();           ...

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); }