Skip to main content

Posts

Showing posts with the label Dyn365FO

Embed PowerApps in Modern POS

There was a feature released around 8.1.3 to open URL in POS. https://docs.microsoft.com/en-us/dynamics365/unified-operations/retail/open-url-in-pos Follow the guide to add a button to POS via the Screen Layouts. In the Action, select Open URL. Enter the PowerApps url. In this case I want it to open up as embedded rather than popping up with a new window. Run your distribution job to have it show up on POS. Below is an example I am working on. We have an external system managing licensing. Just note, that it will pop up with a Microsoft login screen. You can tick the login to remember you. If the screen doesn’t fit in the POS window. You can click on “Fit to screen” on the top right. Hope this gives you ideas to take advantage of in Retail space. Possibilities are endless.

Data Entity stuck “In Process”

There are a few reasons a scheduled data job may not execute. I made a silly mistake and it seemed as though the jobs where stuck on “In process”. Things I checked: 1. Check the job isn’t disabled. See screenshot below. There is a toggle. 2. Check your recurring batch job is scheduled 3. Check you haven’t made any mistakes when enqueuing the entity. (I made a typo here) I made the mistake of copying the URL and not changing the entity name. See the highlighted part in the url. https://myenviornment.cloudax.dynamics.com/api/connector/enqueue/123456789-5506-4314-874D-3CF51A7AE15A?entity= General%20journal &company=usmf Below is a screenshot of the record info. You can see the Entity field contains the string I passed via the enqueue URL. Sounds pretty simple but hopefully helps someone out there.

Send to Azure Service Bus in #MSDyn365FO

Sending a message to Azure Service Bus is really simple in FinOps. Below is the job I wrote to send a message to the service bus. It takes a connection string and a queue name for connecting. The message string and key value pair list can be supplied to the properties. static str connectionString = 'Endpoint=sb://navaxservicebus.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=h5KwXSEFIHxxxxxxxxxxxxxxxxxx'; static str queueName = 'navaxqueue'; /// <summary> /// Runs the class with the specified arguments. /// </summary> /// <param name = "_args">The specified arguments.</param> public static void main(Args _args) { if (connectionString && queueName) { Microsoft.ServiceBus.Messaging.QueueClient queueClient = Microsoft.ServiceBus.Messaging.QueueClient::CreateFromConnectionString(connectionString, queueName); Microsoft.Ser...

Print a report as a byte array via X++ in #MSDyn365FO

In the last post I showed how to print the sales invoice as a pdf. In this post we will do the same but generate a byte array of the pdf report. I tried to make the code as readable as possible and hopefully can use it on other reports.. public static str printSalesInvoiceBase64Str(SalesInvoiceId _salesInvoiceId) { str ret; CustInvoiceJour custInvoiceJour; select firstonly custInvoiceJour where custInvoiceJour.InvoiceId == _salesInvoiceId; if (custInvoiceJour) { str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP); PrintMgmtReportFormatName printMgmtReportFormatName = PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat(); SalesInvoiceContract salesInvoi...

Using Global Variables with Retail Modern POS

I am using version 8 platform update 15. Since the POS development is locked out and extensions only is allowed. There are some limitations and a number of objects are not accessible. I was trying to navigate to the customer search and allow the user to select a customer and return to the calling form. This was very challenging. One possible solution I found is to use Global variables. I used the window object. To do this, declare the window object as per screenshot. And then just set your object : eg. window.MyVarName = WhatEverObject; To get the value just invert it. You can see how I have the customer object in debug. Credit to one of my colleagues who suggested this solution.

Testing #MSDyn365FO Odata with Postman

Last year I posted on using Postman. Things have changed since then and I need to update. http://dynamicsnavax.blogspot.com/2017/05/dynamics-365-for-operation-web-service.html There is a good article that Microsoft has written which I followed without any issues. https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/third-party-service-test#prerequisites Below are some screenshot incase you are a visual person like me. In the environment set ups. It should looks something like this. When you run it, you should get a response. Once you got the token. You are good to go with your messages. Below is the same example from the blog post. You run into any problems, click on the console icon at the bottom. Should give you a bit more information. If you get a 401 error. It is usually a typo. Make sure you got the spaces and backslashes correct. One simple character can drive you crazy.

Import document handling (attachment) files #MSDyn365FO

Out of the box you have limited data entities for migrating attachments. If you search what is already in the AOT, you will see a few various examples. I suggest you look at the LedgerJournalAttachmentsEntity as it is the simplest and cleans to copy from. I wont go into detail but I will give a quick run down of what it looks like. Use the DocuRefEntity as your main datasource. It does most of the work for you. Set your table you want to import for as the child datasource Add the Key You will need to add the postLoad method. There is minor code to update the virtual field FileContents. Below is an export I did for the general journal attachments. The import zip structure should be the same way. It will create the usual artifacts such as the excel, manifest and package header xml files. You will see a Resources folder under that. If you drill down to the resources you will see the attachments. This is an export and it used the document GUID for uniqueness. The other thing is the extensi...

Add a new starting worker for workflow hierarchy approval #MSDyn365FO

This is very simple but not too obvious. There are times when you want to start the hierarchy approval with a specific worker and then have it traverse up the hierarchy. See screenshot below screenshot of some of the options. You may want to add something different to what is already available. The way it works is, it uses certain EDTs on the table. So, all you need to do is add a field that extends one of these EDTs. Or just subscribe to the delegate to add another EDT. Below is some code that could give inspiration.

Add Spending/Approval limit to Purchase Order Workflow #MSDyn365FO

I feel this is very limiting when you try to use purchase order workflow via hierarchy assignment. The set up is there but you really can’t use it to the end. When you try to set up a stop condition, you can’t really use it. Vote for the idea for Microsoft to develop this. https://experience.dynamics.com/ideas/idea/?ideaid=6b55a93d-7235-e811-bbd3-0003ff68aa57 Below is a screenshot of how I have added it. NOTE: Screenshot shows the field. However, I should have shown it using the automatic actions. To show that it is available to have an auto approve if spending limit of the requester is above the limit. To add these fields or any dynamic (calculated) field is very simple. Just a parm method to the workflow document class. For this example, I just copied the parm method and made it point to the PurchTable. Copy from PurchReqDocument to PurchTableDocument Here is a class I put together to show you how I added the spending limit. https://github.com/munib00/WorkflowPlus/blob/mas...

Approve Workflow via email using template placeholders #Dyn365FO

Dynamics 365 for Finance and Operations has placeholders which can be inserted into the instructions. Normally you would want this to show up in the email that is sent. One of the most useful ones is the URL link to the exact record that you are approving. In the workflow configurations use the placeholder and build up your message. Towards the end it has workflow specific ones. The URL token is %Workflow.Link to web% . For the technical people the token is replaced in this class WorkflowDocumentField. This is what I inserted into my email template. <BODY> subject: %subject% <BR> message: %message% <BR> company: %company% <BR> for: %for% <BR> </BODY> Should look like this. The final result looks like this. If you debug these are the place holders that are put together.