Saturday, April 1, 2023

How to enable new Microsoft teams - Public Preview!

New Microsoft Teams is just AWESOME, quick but useful post below shows how you have this preview feature to make your life EASY! 


Open Microsoft Teams admin center [Ask admin in your organization if you don't have access] and follow path Teams > Teams update policies > Click on an existing policy or Create New > follow step 1 and step 2 below.


Toggle Try the new teams to get yourself into NEW TEAMS world, you may chose to go back to classic (GA) version at any point of time.


Let the change happen!





Get it, Preview new Teams!



Experience teams across tenants and get notifications from multiple tenants accounts. This is PRETTY COOL!






Saturday, March 18, 2023

Electronic Reporting: Send vendor payments to external azure storage via X++

Electronic Reporting module in Microsoft Dynamics 365 Finance Operation lets you archive file generated by ER at SharePoint location and in Azure Storage as per this link Archive ER destination type - Finance & Operations | Dynamics 365 | Microsoft Learn. APIs can be used to check message status and read file from either location. Logic Apps or Power Automate can be used to make a call to APIs, read files, and perform required action. This post is not about how this can be done via integration :) It's been a while I haven't written a full code base post (no low code :))

To send ER generated files directly to your provided Azure Blob Container, below is the sample class.

using Microsoft.Azure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.File;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Auth

class DAX_ERVendPaymOutFieUploadHelper
{

    /// <summary>
    /// Handles attachingFile event from Electronic reporting
    /// </summary>
    /// <param name = "_args">Event args for event handler</param>    [SubscribesTo(classStr(ERDocuManagementEvents), staticDelegateStr(ERDocuManagementEvents, attachingFile))]
    
public static void ERDocuManagementEvents_attachingFile(ERDocuManagementAttachingFileEventArgs _args)
    {
        
ERFormatMappingRunJobTable  ERFormatMappingRunJobTable;
        
Common                      common = _args.getOwner();

        if(common.tableid == tableNum(ERFormatMappingRunJobTable))
        {
            ERFormatMappingRunJobTable = 
ERFormatMappingRunJobTable::find(common.RecId);
        }   

        if (!_args.isHandled() && ERFormatMappingRunJobTable.Archived == noyes::No)
        {
            DAX_ERVendPaymOutFieUploadHelper uploadHandler = DAX_ERVendPaymOutFieUploadHelper::construct();

            uploadHandler.uploadFile(_args.getStream());
        }
    }

    /// <summary>
    /// Creates an object of DAX_ERVendPaymOutFieUploadHelper class
    /// </summary>
    /// <returns>DAX_ERVendPaymOutFieUploadHelper class object</returns>

    public static DAX_ERVendPaymOutFieUploadHelper construct()
    {
        return new DAX_ERVendPaymOutFieUploadHelper();
    }

 

    /// <summary>
    /// Uploads file to custom Azure blob container specified in parameters
    /// </summary>
    /// <param name = "_fileStream">File stream to be uploaded</param>
    /// <returns>True if file uploaded successfully</returns>

    private boolean uploadFile(System.IO.Stream _fileStream)
    {
        boolean ret = true; 

        // Custom parameters table to store Azure Storage and container info
        DAX_Parameters parameters = DAX_Parameters::find();

        try
        {
            StorageCredentials credentials = new StorageCredentials(parameters.StorageAccountName, parameters.Key);

            CloudStorageAccount storageAccount = new CloudStorageAccount(credentials, true);

            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();          

            CloudBlobContainer rootContainer = blobClient.GetContainerReference(parameters.ContainerName);          

            if(!rootContainer.Exists(nullnull))
            {
                return Checkfailed('Azure storage parameters are not set up correctly.');
            }

            CloudBlobDirectory directory = rootContainer.GetDirectoryReference(parameters.BankOutPaymFolder);

            CloudBlockBlob blockBlob =                directory.GetBlockBlobReference(strFmt('VendOutPaym.xml'));

             if (_fileStream.CanSeek)
            {
                _fileStream.Seek(0, System.IO.SeekOrigin::Begin);
            }

            blockBlob.UploadFromStream(_fileStream, nullnullnull);
            Info('File uploaded');
        }

        catch(Exception::Error)
        {
            ret = checkFailed('Error occurred while uploading the file');
        }

        catch(Exception::CLRError)
        {
            ret = checkFailed('CLR Error occurred while uploading the file');
        }

        return ret;
    }
}


Sunday, June 5, 2022

Download large bacpac (sandbox database) to DEV environment much faster

As the LCS website gets slower and slower and the database backups get bigger and bigger. Use AZCopy to download objects out of LCS asset library. it is an incredibly quickly vs manually downloading the files (>1min for a gig vs 1 hour+)








Download AZCopy to the environment (https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?toc=/azure/storage/files/toc.json#download-azcopyand user the PowerShell command: .\azcopy copy "LCS SAS Link" "LocalPath"

D The only issue I noticed is that the local path had to be into a folder, not the root of the drive (so "C:\Temp" not "C:\" which is more related to windows security then anything else.

Below is the example:

Extract AzCopy zip folder to C:\Temp folder



Extract It took 3 minutes to download almost 18 GB of data file - WOW feeling :)


Sunday, November 14, 2021

Get your Dynamics 365 FO tier 2 (sandbox) environment today!!

Pakistan User Group is hosting FREE training program for everyone covering Microsoft Business Application and Azure components of Microsoft EcoSystem from beginners to advance level. Register now if you have not yet and join us on Saturday 20th November at 4pm Pakistan Standard Time (GMT + 5).

All details apart, this post is a quick guide to get your own Microsoft Dynamics 365 Finance Operations tier 2 environment FREE!! I will create step-by-step videos to explain all these steps in details, I know it requires detailed explanation. Subscribe https://www.youtube.com/c/DaxtureD365FO 

Let's begin...

Open this URL https://dynamics.microsoft.com/en-au/intelligent-order-management/overview/?ef_id=e0b92d13d85e177270894c83385bd79c:G:s&OCID=AID2200017_SEM_e0b92d13d85e177270894c83385bd79c:G:s&msclkid=e0b92d13d85e177270894c83385bd79c and click on Request a demo and sign up now

















Enter work or school email address (create new if you don't have one - this can be gmail or hotmail account so don't worry too much - it should be your and valid email as you will receive email confirmation on this account), upon entering your email account it will ask you set up a new account. 

Complete all steps and verify your account either via email or SMS.















Get Started 

Choose region on next screen and Submit











Log on to Lifecycle Services https://lcs.dynamics.com with an account you created above (e.g. I created this account 1DynamicsDaxture@1dynamics675.onmicrosoft.com). First time you will following screen 












Click on + sign to create new project (Select product of your choice - I have chosen Finance and Operations) 








Project is created, click on Project onboarding  and follow the documentation to complete project onboarding. This is a must step before environments will get deployed. Comment to discuss more about this process with me.
















Upon project onboarding completion, the configure button will be enabled (note for this example, I have not completed the onboarding process hence the configure button is disabled)

Configure new environment following MS docs article - any question again ping me directly. This will take less than an hour to deploy new sandbox (tier 2) environment for Finance Operations. This also creates a new environment in power platform, check it from this URL https://make.powerapps.com/environments
Sign up for FREE on portal.azure.com for 1 month using same account :)
I know there are steps require more explanation, I will create short videos on all steps and share. Stay Tune!! 


Monday, April 26, 2021

MS D365 FinOps: How to create new LCS project and deploy Tier 1 (DEV) VM - Even you are not a MS customer or partner :) - Part I

Scenario:

You are willing to work on Microsoft Dynamics 365 Finance Operations product and want to get your hand dirty with some development. You are hearing so much about this product but never got a chance to work on this MS ERP. 

Andre wrote a detailed post on how you can setup a trial environment for MS D365 Finance Operations

Solution:

With this post I will explain a step-by-step guide on how;

  1. to create your own LCS project
  2. to deploy a new Tier 1 VM
  3. to log on to Azure Portal
  4. to access Power Platform environments
  5. to create your own power app and use other features
  6. to deploy solutions in Power Platform to integrate with Finance Operations

NOTE: You would need Azure Subscription to deploy VM

First create new domain to perform all above steps - its easy just follow following steps

1. Open this site Office 365 E3 in cognitive mode or as guest and go with Free Trial option









2. Fill in details - you can use your personal email or sign up for a new email account and use that one












3. Provide as much as information you can - it will be good for you :)














4. Choose verification method, I always select text me 















5. Provide Once verified enter your business details and check the availability
























6. Sign up and you are ready to use this account to perform all above steps mentioned under solution section











Manage your subscription option will take you to Microsoft 365 admin center where you will have 25 free user license for the whole month. You can use this account to sign up for teams and enjoy all features for the whole month FREE!!










Log on to LCS lcs.dynamics.com using above created account

Create new project by clicking on + sign and fill information - product name should Finance and Operations










Your LCS project is ready, click on hamburger sign and go to Project setting













Under Organization and ownership the type should be either customer or partner which will be one of them based on the account you have used to log on to LCS. If your account is linked to a partner organization then this will be partner and it will be customer if your account is of type customer.

Remember, the created account in post is not linked to either Partner or Customer so we cannot deploy any tier 1 environment in LCS as in order to connect to Azure portal with LCS the company account should be either customer or partner. 

So, we are blocked here :(


Here is the trick to convert this prospect account to customer account to unblock ourselves. 

Browse https://trials.dynamics.com/ and choose Finance and Operations, enter your new account and hit Get Started. This will deploy a new trial environment with demo data in next 30 minutes. Read Andre's post to find the downside of this environment.















After trial environment deployed, refresh project settings page (you can sign out and sign in again in) to see the changes where it has changed type from prospect to customer











Now you are the customer so let's continue our journey of completing our solution but this is it for this post and we will continue deploying cloud hosted environment through LCS in azure portal in next post.

How to enable new Microsoft teams - Public Preview!

New Microsoft Teams is just AWESOME, quick but useful post below shows how you have this preview feature to make your life EASY!  Open Micr...