Posts

Unable to connect dev machine as errors getting locked there were too many logon attempts or password change attempts in D365 F&O

 Please refer this blog As a security precaution, the user account has been locked because there were too many logon attempts or password change attempts errors in D365 F&O

Debug in tier-2 environment

 Please follow the steps: D365 F&O: Debug the Sandbox/Test environment in D365FO If required skip masterDB connect and execute Store producer step.

After Adding user in F&O not authorized to open url in Dev mahine

Image
 Hi Viwers, Sometimes after adding the user account in system administer>> user  in F&O. User uanble to authorize the F&O url even the user is enable to telemetry not created. In such case, we can directly update objectID to the user by sql. This objectid id unique for each user across all the machines.

Show un committed records in between transaction in Sql

 select * from SALESTABLE  WITH (NOLOCK) 

Get ledger dimension from Main account with combination default dimension in ledgers

 Hi Viewers If you want to get ledger dimension based on only main account. please check below code.         RecId mainAccountRecId =  MainAccount::findByMainAccountIdAndCOA(mainaccount, LedgerChartOfAccounts::current()).RecId;         RecId defaultDimension = MainAccountLegalEntity::findByMainAccountLegalEntity(mainAccountRecId, CompanyInfo::find().RecId).DefaultDimension;         ledgerjournalTrans.LedgerDimension = LedgerDimensionFacade::serviceCreateLedgerDimension(LedgerDefaultAccountHelper::getDefaultAccountFromMainAccountIdAndCOA(mainaccount, LedgerChartOfAccounts::current()), defaultDimension);         ledgerjournalTrans.DefaultDimension = defaultDimension;

Add a check digit on generating number sequence through code x++ in d365F&O

 Hi Viewers, We a check digit on generating  number sequence through code x++. Check digit is a digit added as last digit to avoid wrongly entered by user. This didgit is summation of all the digits in the generated number. X++ code as follows.  public static str addCheckDigit(str _numberSeqNum)  {      return strFmt("%1%2", _numberSeqNum, modulo10(_numberSeqNum));  }  

How to load number sequence automatically on sandbox/trier-2/production environment along with package deployment.

 Hi Viewers, We can load number sequence automatically on sandbox/trier-2/production  environment along with package deployment. without using runnable class or custom script. We can use delegate method in  NumberSequenceModuleSetup class to load custom number sequence as shown below.    [SubscribesTo(classStr(NumberSequenceModuleSetup), delegateStr(NumberSequenceModuleSetup, numberSequenceModuleSetupLoadData))]   public static void NumberSequenceModuleSetup_numberSequenceModuleSetupLoadData()   {       FinTagGroupingNumberSeq     finTagGroupingNumberSeq  = new FinTagGroupingNumberSeq();       finTagGroupingNumberSeq .load();   }

Get customer from dynamic accounts ledger dimensions.

Image
 Hi Viewers, To get customer record from custTable from ledger dimension we can use standard method as below.

Business Event in D365F&O

Image
 Business Events Business events provide a mechanism that lets external systems receive notifications from finance and operations apps. By using this mechanism, you can perform business actions in response to the business events. Business events occur when a business process runs. During a business process, users who participate in it perform business actions to complete the tasks that make up the business process. A business action that a user performs can be either a workflow action or a nonworkflow action. Approval of a purchase requisition is an example of a workflow action, whereas confirmation of a purchase order is an example of a nonworkflow action. Both types of actions can generate business events that external systems can use in integration and notification scenarios. Prerequisites You can consume business events by using Microsoft Power Automate and Azure messaging services. Therefore, you must bring your subscriptions to these assets to use business events. We need end...

Convert contract class object to Json format through x++ in D365 F&O.

Image
 Hi Viewers, We can convert Convert contract class object to Json format through x++ in D365 F&O. By using JsonSerializerExtension class. Ex:  Str jsonString =         JsonSerializerExtension::serializeClass(requestContract);

Parameters in email template in D365F&O in x++

 Hi Viewers, in general email template will be in html file where format already design. In html template we the values like %PO%. on runtime this parameters will be replace by system values. public void generateEmail(purchID _purchID) {     sysemailsystemTable emailSystemTable;     sysEmailMessageSystemTable emailMessageSystemTable;   emailMessageSystemTable = sysEmailMessageSystemTable::find(emailID,  defaultLanguage); #define.PO('PO'); map templateTokens = new Map(Type::string, Type::String); templateTokens.insert(#PO, _purchID); }

How to add access in D365F&O

Image
 

Auto submit and Confirm purchase order in batch through code in X++ in D365F&O.

 Hi Viewers, Here is the code used for create new return order, auto submit workflow if any and confirm PO in batch. public void createAndConfirmReturnOrder(str _workOrderId)     {         PurchTable purchTable, returnPurchTable;         VersioningPurchaseOrder versioningPO;         purchTable = PurchTable::find(_workOrderId);         ttsbegin;         returnPurchTable.initValue(PurchaseType::ReturnItem);         returnPurchTable.initFromPurchTable(purchTable);         returnPurchTable.OrderAccount = purchTable.OrderAccount;         returnPurchTable.initFromVendTable();     ...

How to in visible a parameter in contract class in dialog form in x++ in D365F&O Sysoperation framwork

 Hi Viewers, To make parameter not visible in dialog form if it is populating from contract class. use attribute  SysOperationControlVisibilityAttribute. [DataMemberAttribute         ,  SysOperationControlVisibilityAttribute(false) ]     public NoYes parmRevalidate(NoYes _validate = validate)     {         validate = _validate;           return validate;     } Thanks for reading! Like this post if you found it helpful. 😀😀 And let me know your thoughts in the comments below.😇😇

Batch Bundling Multi threading in x++ in D365F&O.

Hi Viewers, 🧺 Batch Bundling: The Efficiency Trap Batch Bundling is a simple idea: Take a big pile of work and divide it into smaller, equal-sized groups—called bundles —and assign each group to a different processor. Think of it like dividing a huge stack of mail into 10 smaller bundles, and giving one to each of your 10 assistants. Cons: However, a major drawback can occur: even if every bundle contains the same quantity of work items, the effort required for each item may be vastly different. The problem comes down to complexity. While each bundle has the same number of items (say, 100 sales orders), the work required for each item isn't the same. One bundle might contain 100 simple, single-item orders. Another might contain 100 massive, multi-line corporate orders. The assistants who got the simple bundles are done in minutes. But the others are still slogging through the complex work. Now, you have a bunch of people sitting idle , waiting for the others to finish. You...

Interview Questions D365F&O x++

  1. Table hierarchy. 2. cache lookup 3. Table properties 4. form life cycle. 5. Delete actions. 6. Types of integrations 7. Types of relations 8. 

Add contract class in to other contract class in x++ in d365F&O

    List items = new List(Types::Class);     [DataMemberAttribute("Items"),     DataCollection(Types::Class, classStr(<Name of contract class>)),     AifCollectionTypeAttribute('_items', Types::Class, classStr(<Name of contract class>)),     AifCollectionTypeAttribute('return', Types::Class, classStr(<Name of contract class>))]     public List parmitems (List _items = items )     {         items  = _items ;         return items ;     } Thanks for reading! Like this post if you found it helpful. 😀😀 And let me know your thoughts in the comments below.😇😇

Cancel Post packing slip from all Shipments in D365 F&O through X++

 Hi Viewers, To Cancel Post packing slip for Shipments. we first have to cancel the Packing slip, reverse the shipment, and then reopen the container. To Cancel Post packing slip:   WHSLoadTableCustPackingSlipJour loadCustJour;  CustPackingSlipJour             custJour;    WHSLoadTable        loadTable;        loadTable = whsshipmenttable::find(ShipmentID).whsLoadTable();      while select custJour          where custJour.Qty          exists join loadCustJour              where loadCustJour.WHSLoadTableLoadId       == loadTable.LoadId              &&    loadCustJour.WHSLoadTableDataAreaId   == loadTable.DataAreaId              &&    loadCustJour.CustPa...

In ax D365F&O post packing slip from shipment through code x++.

 Hi viewers, To post the packing slip for the sales order from the shipment, we first have to close the containers, confirm the shipment, and then post the packing slip. these steps can be handled either through code or manually updated from the form by the user. I am sharing the code to update accordingly. To Close the container.  public void closeContainer()  {       WHSContainerTable               containerTable;      WHSCloseContainerProfile        closeContainerProfile;      WHSShipmentTable                shipmentTable;                containerTable = WHSContainerTable::findByContainerId(PackageDetailsTable.ContainerId);          closeContainerProfile = WHSCloseContainerProfile::find(containerTable.CloseContainerProfileId);         ...

Call third party API from D365F&O through code x++, with Authentication key and user login

 Hi viewers, Please check the code to call third-party API from D365 F&O through code x++. For authentication sample code:   public str getKey()   {       System.Net.HttpWebRequest request;       System.IO.Stream stream;       System.Exception sysEx;       str responseBody;       container con;       request = System.Net.WebRequest::Create(" URL") as System.Net.HttpWebRequest;       request.Method = 'post';       request.ContentType = 'application/json';       str jsonstring = strFmt('%1%2%3%4%5%6%7','{','"login"',':','"info@****.com",','"password":','"******"','}');       var utf8 = System.Text.Encoding::get_UTF8();       var byteArrayPayload = utf8.GetBytes(jsonstring);       using (System.IO.Stream dataStream = request.GetRequestStream())       {        ...