Ax7 Archives -

Tag Archives: Ax7

How to enable out of the box hyperlink feature for SSRS Reports in D365 Finance and Supply Chain Management

 In D365 Finance and SCM there are lot of out of the box SSRS reports in which you have hyperlink to move to that particular record (for example Ledger transaction list). But sometimes when you update environment you might end up with no such option in you SSRS report as you can see in following screenshot.  To enable hyperlink features you need to follow following steps:- Navigate to feature management and go to all section in that Search for Report drill through links and disable this feature Search for Report PDF viewer and disable     you need to disable this feature for following limitation which you can find in screenshot. Now check desired SSRS reportNow you are able to see hyperlinks links in the reports I hope this post will be helpful to you, Thank you!

Sales return order line registration in D365FO and AX 2012

Introduction: Sales return order line registration in X++ Details:  Consider SalesReturnOrderRegisterLine is the table where records are with SalesLine referenced. If we are required to register serialized items than salesReturnOrderRegisterLine.inventSerialId will be considered and if item referred with batch then salesReturnOrderRegisterLine.inventBatchId will be considered. public static void inventoryRegistration(SalesId _salesId) { SalesReturnOrderRegisterLine salesReturnOrderRegisterLine; SalesLine salesLine; TmpInventTransWMS tmpInventTransWMS; InventTransWMS_Register inventTransWMS_Register; InventDim inventDim; InventTrans inventTrans; VendPackingSlipTrans vendPackingSlipTransLoc; InventTransOrigin inventTransOrigin; while select salesReturnOrderRegisterLine where salesReturnOrderRegisterLine.SalesId == _salesId { salesLine = SalesReturnOrderRegister::updateDispositionCode(salesReturnOrderRegisterLine.InventTransId); inventTransWMS_Register = InventTransWMS_Register::newStandard(tmpInventTransWMS); select firstonly inventTrans where inventTrans.StatusReceipt == StatusReceipt::Ordered exists join inventTransOrigin where inventTransOrigin.RecId == inventTrans.InventTransOrigin && inventTransOrigin.InventTransId == salesLine.InventTransId && inventTransOrigin.ReferenceId == _salesId; tmpInventTransWMS.clear(); tmpInventTransWMS.initFromInventTrans(inventTrans); tmpInventTransWMS.InventQty = salesReturnOrderRegisterLine.SalesQty; tmpInventTransWMS.LineNum = int642int(salesLine.LineNum); inventDim = salesLine.inventDim(); inventDim.inventSerialId = salesReturnOrderRegisterLine.inventSerialId; inventDim.inventBatchId = salesReturnOrderRegisterLine.inventBatchId; tmpInventTransWMS.InventDimId = InventDim::findOrCreate(inventDim).inventDimId; tmpInventTransWMS.ItemId = salesLine.ItemId; inventTransWMS_Register.writeTmpInventTransWMS(tmpInventTransWMS, inventTrans, InventDim::find(tmpInventTransWMS.InventDimId)); if (!inventTransWMS_Register.updateInvent(salesLine)) { throw error(“Error during sales return order registration”); } } } Consider SalesReturnOrderRegister is the class which has below static methods public static SalesLine updateDispositionCode(InventTransId _inventTransId) { SalesLine salesLine = SalesLine::findInventTransId(_inventTransId, true); ReturnDispositionCode returnDispositionCode; SalesReturnOrderRegister::runPreReturnOrderRegisterLine(salesLine); salesLine.ReturnDispositionCodeId = returnDispositionCode.DispositionCodeId; salesLine.update(); return salesLine; } public static void runPreReturnOrderRegisterLine(SalesLine _salesLine) { InventTransOriginId salesLineInventTransOriginId; InventTransOriginId reservationLineInventTransOriginId; SalesLine reservationLine; ReturnDispositionCode returnDispositionCode; if (_salesLine.ReturnStatus == ReturnStatusLine::Awaiting) { if (!_salesLine.ReturnAllowReservation && _salesLine.isStocked()) { SalesLine::changeReturnOrderType(_salesLine.InventTransId); _salesLine = SalesLine::findInventTransId(_salesLine.InventTransId, true); } select firstOnly returnDispositionCode where returnDispositionCode.DispositionAction == DispositionAction::Credit; _salesLine.ReturnDispositionCodeId = returnDispositionCode.DispositionCodeId; _salesLine.update(); } else if (_salesLine.ReturnStatus == ReturnStatusLine::Registered) { select forupdate firstonly reservationLine where reservationLine.InventRefTransId == _salesLine.InventTransId; if (reservationLine || _salesLine.qtyMarked()) { if ((_salesLine.returnDispositionCode().DispositionAction == DispositionAction::ReplaceScrap || _salesLine.returnDispositionCode().DispositionAction == DispositionAction::ReturnToCust || _salesLine.returnDispositionCode().DispositionAction == DispositionAction::Scrap)) { if (reservationLine.SalesQty == reservationLine.RemainSalesPhysical) { reservationLineInventTransOriginId = InventTransOriginSalesLine::findInventTransOriginId(reservationLine.DataAreaId, reservationLine.InventTransId); salesLineInventTransOriginId = InventTransOriginSalesLine::findInventTransOriginId(_salesLine.DataAreaId, _salesLine.InventTransId); InventTransOrigin::deleteMarking(salesLineInventTransOriginId, reservationLineInventTransOriginId, -_salesLine.QtyOrdered); reservationLine.delete(); } } else { throw error(“@SYS332911”); } } } } Thanks for reading and stay connected with us for more updates!!! Jagdish Solanki | Senior Technical Consultant | CloudFronts Business Empowering Solutions Team “Solving Complex Business Challenges with Microsoft Dynamics 365 & Power Platform”

Message API – Message::AddAction() in D365FO Version 10.0.10 PU34 | New Feature

Introduction: From the version 10.0.10 Platform update 34, Microsoft has added a new feature Message::AddAction() which is shown in the message bar.  Details: Message API associated with display or action menu items, which is visualized as a hyperlink/link button.  It is linked with a single record at a time, called single action. In below taken example, we will show sales order is navigated to the form SalesTable from the message bar. For testing it, we’ll create the runnable class also know as job in AX 2012.  class CFSMessageAPI { public static void main(Args _args) { SalesTable salesTable = SalesTable::find(‘SH-000121′); MenuItemMessageAction actionData = new MenuItemMessageAction(); actionData.MenuItemName(menuItemDisplayStr(SalesTable)); actionData.TableName(tableStr(SalesTable)); actionData.RecId(salesTable.RecId); str jsonData = FormJsonSerializer::serializeClass(actionData); int64 messageId = Message::AddAction(MessageSeverity::Informational, “Sales order details”, salesTable.customerName(), MessageActionType::DisplayMenuItem, jsonData); } } Let’s see how it works,  In my case it’s showing Mitchell. Click on the link.  After clicking on the action link, it is navigated to the sales order record form as shown in the above link.  Hurray, How pretty feature is released !!! Conclusion: In above example, we have seen how Message API is routed to the record. Thanks for reading !!!

Import CSV file in D365 for Finance and Operation using X++

Below is a simple example for importing data from CSV file in D365 FO using X++: /// <summary> /// import color code /// </summary> class CFSImportColorCode {     /// <summary>     /// main     /// </summary>     /// <param name = “_args”>_args</param>     public static void main(Args _args)     {         AsciiStreamIo                       file;         Array                               fileLines;         FileUploadTemporaryStorageResult    fileUpload;         CFSEcoResColorCode                  colorCode;         CFSImportColorCode                  importColorCode = new CFSImportColorCode();         Counter                             counter = 0;         EcoResColorName                     color;         #OCCRetryCount         try         {             //Upload a file             fileUpload  = File::GetFileFromUser() as FileUploadTemporaryStorageResult;             file        = AsciiStreamIo::constructForRead(fileUpload.openResult());             if (file)             {                 if (file.status())                 {                     throw error(“@SYS52680”);                 }                 file.inFieldDelimiter(‘;’); //separator                 file.inRecordDelimiter(‘\r\n’);             }             //Read a CSV File             container rec;             ttsbegin;             while (!file.status())             {                 counter++;                 rec = file.read();                 if (conLen(rec))                 {                     color = conPeek(rec, 2);                     colorCode = CFSEcoResColorCode::find(color);                     if(!colorCode.RecId)                     {                         colorCode.clear();                         colorCode.Name  = color;                         colorCode.Code  = conPeek(rec, 1);                         colorCode.insert();                     }                 }             }             ttscommit;             info(“Operation complete.”);         }         catch (Exception::Deadlock)         {             retry;         }         catch (Exception::UpdateConflict)         {             if (appl.ttsLevel() == 0)             {                 if (xSession::currentRetryCount() >= #RetryNum)                 {                     throw Exception::UpdateConflictNotRecovered;                 }                 else                 {                     retry;                 }             }             else             {                 throw Exception::UpdateConflict;             }         }     } }

“Cannot delete a record in batch job(BatchJob). The corresponding AOS validation failed “while deleting batch job

while you want to delete batch job in Finance and operation you may have faced error as follows “Cannot delete a record in batch job(BatchJob). The corresponding AOS validation failed”.                This blog will be helpful to resolve this issue, just follow mentioned steps. Go to batch job(system administation >> inquiries  >> batch jobs) select batch jobs which you want to delete and press button change status now change its status to canceling as follows after which jobs status will change to canceling and after that it will automatically change to waiting state now try to delete it by pressing delete button. Now select yes to delete record And you have successfully deleted the record. Hope this blog was helpful to you.

Change planned purchase order status as draft insted of default approved

When we create purchase order using planned order its default approval status will be approved as displayed in screenshot. To change that status to draft write following code where we will change its status to draft and further code to is to remove version of purchase order which necessary to make delete button enabled on purchase order form code:- /// <summary> /// extension of class: ReqTransPoMarkFirm /// </summary> [ExtensionOf(classStr(ReqTransPoMarkFirm))] final class ReqTransPoMarkFirmCFSClass_Extension {     public container conPurchOrders;     /// <summary>     /// updatePurchTable     /// </summary>     /// <param name = “_purchTable”>_purchTable</param>     protected void updatePurchTable(PurchTable _purchTable)     {         conPurchOrders += _purchTable.PurchId;         next updatePurchTable(_purchTable);     }     /// <summary>     /// purchTablePostProcessing     /// </summary>     protected void purchTablePostProcessing()     {         next purchTablePostProcessing();         for (int i = 1; i <= conLen(conPurchOrders); i++)         {             PurchTable purchTable = PurchTable::find(conPeek(conPurchOrders, i), true);             if(purchTable.RecId)             {                 ttsbegin;                 //delete the version created for po                 PurchTableVersion purchTableVersion = PurchTableVersion::findLatest(purchTable.PurchId, purchTable.DataAreaId, true);                 if(purchTableVersion.RecId)                 {                     purchTableVersion.delete();                 }                 purchTable.ChangeRequestRequired = NoYes::No;                 purchTable.DocumentState         = VersioningDocumentState::Draft;                 purchTable.update();                 ttscommit;             }         }     } } I hope this will helo you,thank you

Change RFQ purchase order status as draft insted of default approved

When we create purchase order using RFQ its default approval status will be approved. To change that status to draft write following code where we will change its status to draft. create new class and add following code class CFSPOStatusRfq {     [PostHandlerFor(classStr(PurchAutoCreate_RFQ), methodStr(PurchAutoCreate_RFQ, endUpdate))]     public static void PurchAutoCreate_PurchReq_Post_endUpdate(XppPrePostArgs args)     {         //PurchTable  purchTable = args.getThis(‘purchTable’);         PurchAutoCreate_RFQ purchReq = args.getThis() as PurchAutoCreate_RFQ;         PurchTable  purchTable, purchTablenew;         purchTable = purchReq.parmPurchTable();         ttsbegin;         select forupdate purchTablenew where purchTableNew.PurchId == purchTable.PurchId;         if(purchTablenew && purchTablenew.DocumentState == VersioningDocumentState::Approved)         {             purchTablenew.DocumentState = VersioningDocumentState::Draft;             purchTablenew.update();         }         ttscommit;     } }

Table Browser Extension for Google Chrome | D365

Now table browser becomes much easier for Microsoft Dynamics 365 Finance and Operations. Here you go with Google Chrome Extension – Table browser caller for D365FO. It’s very easy to install and use it. After installing the extension to the browser, it appears on the top bar and looks like While clicking on the extension, You can find the tab named with config where you need to put the URL of the respective environment and save it. Once config is setup, you need to go to the main tab that is Table Browser Caller as shown in above figure where you would setup mainly:  Search for table name: name of the table Company Id: name of the legal entity  After that, you need to find the table in the search box and just press the Enter key. And you will be redirected to the table in the new tab.  In addition, Table browser has also few other features like Browse all table lists  Browse all data entities   1. For getting the list of tables you need to click on Table list: Result as,  2. For getting the list of data entities you need to click on Data entities:  Result as, 

Set form control access via security role in D365 Finance

In some of the cases instead of providing security to whole form we need it for particular form control.So this blog will help you with providing access to form control via security roles.If you want to know more about security roles you can use my previous blog . First of all we need form control where we need to set some of the properties as follows. In our case we are using laid off button as shownNow select the button and press F4 for its properties and set needed permision to manual as follows Now in your desired security privilege you can either directly set form control permissions or Entry Points.For form control permission method right click on form control permission and select new form and after that set name property to your desired form (Hcmworker in our case) as follows Now right click on your form and select New control option as follows and set control name and permission for it as follows For Entry point method you need first need to add new entry point and set its object type and object name properties or for existing ones select desired entry point and click on drop down arrow and on controls right click and select new control.And now set its grant and name properties to desired control and its access rights After this you need to assign this privilege in desired security role and security duty as previously discussed in security role blog

Create security role in D365 Finance and operation

In D365 Finance and Operations when you need to provide and restrict users from a certain operation you can make use of security roles. You can create security roles from Finance and operations environment itself or from its development tool i.e Visual Studio. In this blog, we are going to create a security role in Visual Studio as follows.   Create privilege    First of all we need to create privilege as follows now we need to add new entry point and set  object type in our case display menu item from properties Now add object name(display menu item  name) as follows   create role   Now we need to create role where above created privilege will be needed create new security role  as follows now we need to add new privilege in role as shown And from properties select privilege which we have created in previous step Create Duty   Now we have to create new duty and assign previously created privilege in its properties as shown Now we can see security role in FnO environment select any user from system administration>>users and click on assign role as follows and now search for priviously created role and click on Ok button now your security role is assigned to user with our role will be able to see the object like form, report etc except user with system administrator.  

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange