How to Customize the API management new Developer Portal
Learn how you can customize the new Azure API management Developer Portal.
Share Story :
Auto-refreshing Views or Grid in D365 CRM
We all know that Views show records based on filter criteria that is applied to the Views. But, what if there is a custom button that will change the records status and according to the Views filter criteria it should not be present in the View. The View should have been Auto-Refreshed. We can achieve this by JavaScript. Use Case: We had a requirement where we wanted to Auto-Refresh the View as soon as the status of record is changed. We have a custom button that will change the status of the selected records but when the Status changes, it doesn’t auto refreshes the View. We had to manually reload the page or click on refresh button on the View. Steps: 1. When the status of the Record changes, you have the id of record then there’s a fully supported way which we can use to Auto-Refresh the View: “refreshParentGrid=Refreshes the parent grid that contains the specified record.” 2. In our case, We had the custom button which changes the status of the record. This is the code: Suppose the custom button is called as “Submit”. On clicking the button it should change the Status and also the records should not be visible in the view as the filter criteria is Status= “In Progress and Rejected” 1. The filter of the View. 2. On clicking the Submit Button, the selected record should not be visible. 3. The View Auto-Refreshed and the selected records are not visible in this View. Note: This can be used in Sub-grids of the forms also. Conclusion: I hope this blog helps you to Auto-Refresh the View.
Share Story :
Connect D365 CRM CDS Database from SQL Server
Many times, we feel like why I can’t access D365 CRM Database directly from MS SQL Server, so here is my blog that will guide you on how you can connect D365 CRM CDS Database using MS SQL Server Steps to enable D365 CRM CDS Database to make it connect from MS SQL Server: Login to https://admin.powerplatform.microsoft.com/ using administrator credentials. In Environment section, click on your environment for which you want to enable D365 CRM CDS for MS SQL Server. (In my case I am clicking on DemoEnvironment as shown below.) When Environment opens click on settings in header. Settings page will open, Click on Product and then click on Features. When features Page opens enable TDS Endpoint (Preview) and click save. Now, we have successfully enabled D365 CRM CDS to connect it from MS SQL Server. Steps to Connect CDS Database from MS SQL Server: Open MS SQL Server. In connect to SQL Server Window enter Server name (It will be your D365 CRM URL) followed by comma and Port Number (5558) e.g. of server name yourdomain.crm.dynamics.com,5558. Select Authentication as Azure Active Directory – Password. Enter Username: Your admin user id e.g. admin@xyz.com Enter Password: (Your Login password) ******** Click Connect. Now, you have successfully connected to D365 CRM DB. Write a select query and test if it’s working.
Share Story :
Importing Notes in Dynamics 365 correctly
Preparing an Excel Template for Notes entity is a little tricky. Doesn’t work when you just Export directly as a Template from the Templates Wizard and try to include all columns and import as is. Why? Because there’s no Regarding field exported when you export/import that template. Here’s what you can do as a workaround. Scenario Now, let’s assume you want to Export a standard Excel Template for import so that you can re-import into Dynamics for Notes entity for a regarding entity. Exporting Excel Template Your Document Templates are where all your Excel Templates can be exported from – Now, follow the below – Select Notes entity and Edit Columns you need to Export the Excel with your required columns Select the columns you need. Observe that you don’t get Regarding column to export Then Download the file. Modifying the Excel Now, since you don’t have the Regarding field in the Excel you exported from Templates, here’s what you need to do – Add a column yourself, give it a proper name based on what the Notes’ Parent entity should be. In this example, I’m importing Notes for Account. So, I’m adding a column called ‘Account Name’ A new column will be created as below Now, populate your data based on how the Notes should be imported and tagged to which records. Now, by default, this template is exported in Microsoft Excel Worksheet (xlsx) format. You’ll need to Save As in CSV format Re-Importing Up until above, your Excel is ready to be imported. Let’s begin – Import the file as a usual Excel Import in Dynamics 365 CRM. Since this is not a direct Template importing as is, but a CSV, you’ll get to map this file manually. Then, you’ll need to manually select the Note entity from the drop-down and then proceed Now, whatever is mapped automatically will be mapped. For the newly created Account Name field, you’ll need to expand the Not Mapped dropdown and select Regarding (Lookup) Now, you’ll need to select the entity you want the Notes to appear under. In my case, this is Accounts, so I have it right there Since this Regarding fields supports several entities, scroll all the way down to Confirm your selection Now, your Regarding field is set and you are ready to confirm and Import Now, my Import here is completed. (You’ll need to take care the Import is successful) Imported Notes If you look at the records now, the Notes will be attached to the respective Regarding records Hope this helps!!
Share Story :
Entering Multiple Opportunity Products at once in Dynamics 365 Sales
Very easy tweak but this will save loads of your time. One of the most important asks by Salespeople is perhaps this – “Add multiple Products on Opportunity at once!“ Here’s how you can do this – Classic Experience In current/classic experience, if you open Opportunity Lines and go on to add a Product as below – It’ll either open in a New form.This isn’t intuitive. You definitely need better experience. Enhanced Experience In System Settings, under Sales, you’ll need to enable the Adding Products to Yes. This will enable the enhanced experience. Now, when you click on Add Products in the Opportunity’s Product Line Items tab, you’ll see a Quick Create Form like form on which you can Add Multiple Products in one go. And then go to + Add products Now, a Quick Create form will appear on which you can select multiple products Now, when you click on any + sign in blue, you can directly enter what quantity you want to add. Also, if you go to the Selected section which indicated how many unique products you’ve added, you’ll be able to remove the added Products in case you don’t want them and then Delete the same if needed. Now, let’s say I have this finally and when I click on Add to Opportunity, they get added as Opportunity Lines And they appear as belowHope this helps!!
Share Story :
Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
At times, ever wondered what happened to the Mailbox? You ran some tests, you also got results, but the Alerts section is empty or not generating Alerts. Here’s what’s missing and how the behavior is – Turn on Mailbox Alerts In System Settings, you can turn on what type of Mailbox alerts should be shown. Navigate to Email and scroll down. You can then choose what type of info should be generated in Alerts area in a Mailbox. Error, Warning or Information. Behavior Now, the behavior is a little confusing. Here’s what it is – Any previously generated errors will show if the setting was On initially and was later on turned off down the line.In my example, the last error was generated on 1st July 2020 Now, I turned the setting Off And post that, if there are any new errors/messages, they won’t show up But, after I turn the settings back on New errors after that will start showing up again. Meaning, the duration in which the Alerts are off, those will not be generated. And the duration in which the Alerts are On, they will keep populating the Alerts section. Hope this was useful.
Share Story :
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”
Share Story :
Factbox of workflow history on purchase order in D365FO
Introduction: In this blog, we will see how to create factbox of workflow history of purchase order in Microsoft Dynamics 365 Finance and Operations Details: Well, Factbox is a very pretty cool feature available from the earlier version AX 2012. It is very easy to achieve in Dynamics 365 as well. Here we will see how easy it is and steps for that. As shown in the above image, we will be going to create factbox for the “Tracking details list” Steps: Create the solution in Visual Studio and project for that. We’ll be required four objects mainly that is one display MenuItem, Table, Form (on which to display factbox), another Form (factbox). Reference attached below: 1. Table For displaying workflow history, we need to create the extension of table WorkflowTrackingStatusTable and create the normal relation and its relevant properties as 2. Factbox Now we are required to create the factbox of workflow history. For that we will use the effortless technique, where we will duplicate the standard form “WorkflowStatus” and will name as CFSPurchTableWorkflowHistoryFactBox (give name as per your naming convention standards) After duplicating and renaming the form, we need to change the pattern as “custom” After applying the custom pattern, delete the NavigationList which is not required in factbox, and do visible false ActionPane and PanelTab After that create the new Grid and assign the data source to it in the property and put all the required fields to show in factbox 3. Display MenuItem We will attach the created factbox form to the display menu item and relevant label “Workflow history” 4. Base form Base form we call it as where we will attach the factbox. Here it is purchase form. Go to Parm section and create a new part and give it a relevant name and its properties Properties: Data source: Attached data source with which workflow history is connected Data Source Relation: WorkflowTable.RelationName Name: Part name That’s it. Build the project and go the frontend and check the output how it looks like. Conclusion: It results as (we can scroll left and right to see all the tracking details list) Hurray, How pretty it looks like! In the above example, we have seen how we can develop factbox in Microsoft Dynamics 365 Finance and Operations. 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”
Share Story :
Get/Read Selected Record Information From Main View Or A Sub-Grid using Ribbon Workbench In D365 CRM
There is a common application of getting selected records information while working with custom buttons using Ribbon Workbench. Use Case: We had a requirement, where we needed the information of the all selected records from the Main View and Sub-Grid of an entity. We can achieve in Ribbon Workbench. Steps: 1. The button on which we are customizing is named as “Submit”. 2. In the Command section, click on “Actions” -> “Javascript Action” to add Custom Javascript. Then click on “Add Parameter” -> Click on “Crm Parameter” -> then on SelectedControlSelecteItemReferences. SelectedControlSelecteItemReferences = grabs the information of all selected record from the view. 3. SelectedControlSelecteItemReferences will pass the information of all the selected records in my “selectedItems” variable passed to the method. 4. On clicking the Submit Button, the selected records information will be passed on to the Javascript Code. 5. On clicking the “Submit” button, it will pass the two selected records information to the method that the button is calling. 6. You can further read all the information from the Array and perform the actions that you want. Note: This can be done in Sub-grids of the forms also. Conclusion: Hope this blog helps to get/read the selected Information from the Main View or Sub-Grid
Share Story :
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 !!!