Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all 17314 articles
Browse latest View live

Cost accounting (13)

$
0
0
This post focuses on cost distribution policies and how they differ from cost allocation policies. According to the D365 documentation , cost distribution and cost allocation policies differ in a way that...(read more)

Empty Database in your VHD All-in-one Machine - Microsoft Dynamics 365 for Finance & Operations

$
0
0
Hi All

As you know, in an Azure Sandbox Environment you can decide if create it with or without Data.

This is not possible when you download the VHD All-in-one machine.

In order to achieve this result from my understanding there are two options:
  1. André post, https://kaya-consulting.com/how-to-start-with-empty-ax-database-in-your-local-vm/where you have to create before the Env in Azure with an Empty Database, Backup it and move to your VHD
  2. I have Play around to the VHD Disk C and I notice a folder named “EmptyDataset” with inside a Database backup named “AxBootstrapDB_Empty.BAK”
    I have simply restore this backup file against the AX Database and set the right GUID and email id retrieved from the “old” AX Demo Data.

Till soon!

Use Azure Automation to start and stop your VMs on a schedule

$
0
0
This post is long overdue, and I have been meaning to post it over a year ago.  I did present an early version of this script at the AXUG event in Stuttgart, but since then the API has changed around tags, and also it has become very easy to solve authentication using Run as Accounts. The code I am sharing here works on the latest version of the modules, and I hope it will keep working for years to come.

I few notes before I continue:
  • I base this script off from Automys own code, and it is heavily inspired by the commits done by other users out there in the community. I will refer to the project on GitHub where you will find contributors and authors. 
  • I've only tested and used the script for ARM Resources
  • I removed references to credentials and certificates and it relies on using "Run As Account". Setting it "Run As Account" in Azure is very easy and quick to do.
You will find the Feature branch here:

Setup

I recommend starting by creating a new Automation Account. Yes, you can probably reuse an existing one, but creating a new account does not incur additional costs, and you can get this up and running fairly quick and easy just by following the steps in this blog post.



Make sure you select "Yes" on the option of creating "Azure Run as Account". Let it create all the artifacts and while you wait you can read the rest of this post.

When the Automation account is up and running, the next step is to create a new Runbook of type "PowerShell" - just straight up PowerShell, and no fancy stuff.

Then you grab the script from my feature branch based off the original trunk. You can either take the script from this post, or take the latest from GitHub. I probably won't maintain this blog post on any future updates of the script, but I might maintain the one on GitHub. I'll put a copy down below.

So with the script added as a PowerShell Runbook, and saved. Now you need to Schedule it. This is where a small cost may incur, because it is necessary to set the Runbook to run every hour. Yes - every hour. Using Automation for free only allow for a limited number of runs, and with the Runbook running every hour throughout the day, I believe it will stop running after 20 days - per month. There is a 500 minute limit per month for free, but the cost incurred when you exceed this is extremely low.

With the script running every hour you are ready to schedule "downtime". And this is easy.
You basically just either TAG the VM or the Resource Group holding a collection of VMs.

By TAG I mean you type on the downtime you want for your resource in the VALUE of a specific TAG. The script looks for a tag named "AutoShutdownSchedule". Example of value would be "20:00->06:00, Saturday, Sunday", and you can probably guess when the server will be shutdown with that value... That is correct, all weekdays between 8 pm at night and 6 am in the morning. You can imagine the flexibility this gives.

Added Features

In addition, the script is inspired by other nice ideas from the community, like providing a TimeZone for your schedule, just to ensure your 8 pm is consistent to when the script interprets the value.

Another feature added is the ability to use a "NeverStart" value keyword, to enforce the resource does not start. You can use this to schedule automatic shutdown that does not trigger startup again after the schedule ends. Example is the value "20:00->21:00,NeverStart". This would stop the resource at 8 pm, and when the RunBook runs again at 9 pm, the resource will not start even though the schedule has ended.

Finally, I want to comment the added feature of disabling the schedule without removing the schedule. If you provide an additional tag with the name "AutoShutdownDisabled" with a value of Yes/1/True. This means you can keep the schedule and temporarily disable the shutdown schedule altogether.

The script

<#
.SYNOPSIS
This Azure Automation runbook automates the scheduled shutdown and startup of resources in an Azure subscription.

.DESCRIPTION
The runbook implements a solution for scheduled power management of Azure resources in combination with tags
on resources or resource groups which define a shutdown schedule. Each time it runs, the runbook looks for all
supported resources or resource groups with a tag named "AutoShutdownSchedule" having a value defining the schedule,
e.g. "10PM -> 6AM". It then checks the current time against each schedule entry, ensuring that resourcess with tags or in tagged groups
are deallocated/shut down or started to conform to the defined schedule.

This is a PowerShell runbook, as opposed to a PowerShell Workflow runbook.

This script requires the "AzureRM.Resources" modules which are present by default in Azure Automation accounts.
For detailed documentation and instructions, see:

CREDITS: Initial version credits goes to automys from which this script started :
https://automys.com/library/asset/scheduled-virtual-machine-shutdown-startup-microsoft-azure

.PARAMETER Simulate
If $true, the runbook will not perform any power actions and will only simulate evaluating the tagged schedules. Use this
to test your runbook to see what it will do when run normally (Simulate = $false).

.PARAMETER DefaultScheduleIfNotPresent
If provided, will set the default schedule to apply on all resources that don't have any scheduled tag value defined or inherited.

Description | Tag value
Shut down from 10PM to 6 AM UTC every day | 10pm -> 6am
Shut down from 10PM to 6 AM UTC every day (different format, same result as above) | 22:00 -> 06:00
Shut down from 8PM to 12AM and from 2AM to 7AM UTC every day (bringing online from 12-2AM for maintenance in between) | 8PM -> 12AM, 2AM -> 7AM
Shut down all day Saturday and Sunday (midnight to midnight) | Saturday, Sunday
Shut down from 2AM to 7AM UTC every day and all day on weekends | 2:00 -> 7:00, Saturday, Sunday
Shut down on Christmas Day and New Year?s Day | December 25, January 1
Shut down from 2AM to 7AM UTC every day, and all day on weekends, and on Christmas Day | 2:00 -> 7:00, Saturday, Sunday, December 25
Shut down always ? I don?t want this VM online, ever | 0:00 -> 23:59:59


.PARAMETER TimeZone
Defines the Timezone used when running the runbook. "GMT Standard Time" by default.
Microsoft Time Zone Index Values:
https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx

.EXAMPLE
For testing examples, see the documentation at:

https://automys.com/library/asset/scheduled-virtual-machine-shutdown-startup-microsoft-azure

.INPUTS
None.

.OUTPUTS
Human-readable informational and error messages produced during the job. Not intended to be consumed by another runbook.
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$false)]
[bool]$Simulate = $false,
[parameter(Mandatory=$false)]
[string]$DefaultScheduleIfNotPresent,
[parameter(Mandatory=$false)]
[String] $Timezone = "W. Europe Standard Time"
)

$VERSION = '3.3.0'
$autoShutdownTagName = 'AutoShutdownSchedule'
$autoShutdownOrderTagName = 'ProcessingOrder'
$autoShutdownDisabledTagName = 'AutoShutdownDisabled'
$defaultOrder = 1000

$ResourceProcessors = @(
@{
ResourceType = 'Microsoft.ClassicCompute/virtualMachines'
PowerStateAction = { param([object]$Resource, [string]$DesiredState) (Get-AzureRmResource -ResourceId $Resource.ResourceId).Properties.InstanceView.PowerState }
StartAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'start' -Force }
DeallocateAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'shutdown' -Force }
},
@{
ResourceType = 'Microsoft.Compute/virtualMachines'
PowerStateAction = {
param([object]$Resource, [string]$DesiredState)

$vm = Get-AzureRmVM -ResourceGroupName $Resource.ResourceGroupName -Name $Resource.Name -Status
$currentStatus = $vm.Statuses | Where-Object Code -like 'PowerState*'
$currentStatus.Code -replace 'PowerState/',''
}
StartAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'start' -Force }
DeallocateAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'deallocate' -Force }
},
@{
ResourceType = 'Microsoft.Compute/virtualMachineScaleSets'
#since there is no way to get the status of a VMSS, we assume it is in the inverse state to force the action on the whole VMSS
PowerStateAction = { param([object]$Resource, [string]$DesiredState) if($DesiredState -eq 'StoppedDeallocated') { 'Started' } else { 'StoppedDeallocated' } }
StartAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'start' -Parameters @{ instanceIds = @('*') } -Force }
DeallocateAction = { param([string]$ResourceId) Invoke-AzureRmResourceAction -ResourceId $ResourceId -Action 'deallocate' -Parameters @{ instanceIds = @('*') } -Force }
}
)

# Define function to get current date using the TimeZone Paremeter
function GetCurrentDate
{
return [system.timezoneinfo]::ConvertTime($(Get-Date),$([system.timezoneinfo]::GetSystemTimeZones() | ? id -eq $Timezone))
}

# Define function to check current time against specified range
function Test-ScheduleEntry ([string]$TimeRange)
{
# Initialize variables
$rangeStart, $rangeEnd, $parsedDay = $null
$currentTime = GetCurrentDate
$midnight = $currentTime.AddDays(1).Date

try
{
# Parse as range if contains '->'
if($TimeRange -like '*->*')
{
$timeRangeComponents = $TimeRange -split '->' | foreach {$_.Trim()}
if($timeRangeComponents.Count -eq 2)
{
$rangeStart = Get-Date $timeRangeComponents[0]
$rangeEnd = Get-Date $timeRangeComponents[1]

# Check for crossing midnight
if($rangeStart -gt $rangeEnd)
{
# If current time is between the start of range and midnight tonight, interpret start time as earlier today and end time as tomorrow
if($currentTime -ge $rangeStart -and $currentTime -lt $midnight)
{
$rangeEnd = $rangeEnd.AddDays(1)
}
# Otherwise interpret start time as yesterday and end time as today
else
{
$rangeStart = $rangeStart.AddDays(-1)
}
}
}
else
{
Write-Output "`tWARNING: Invalid time range format. Expects valid .Net DateTime-formatted start time and end time separated by '->'"
}
}
# Otherwise attempt to parse as a full day entry, e.g. 'Monday' or 'December 25'
else
{
# If specified as day of week, check if today
if([System.DayOfWeek].GetEnumValues() -contains $TimeRange)
{
if($TimeRange -eq (Get-Date).DayOfWeek)
{
$parsedDay = Get-Date '00:00'
}
else
{
# Skip detected day of week that isn't today
}
}
# Otherwise attempt to parse as a date, e.g. 'December 25'
else
{
$parsedDay = Get-Date $TimeRange
}

if($parsedDay -ne $null)
{
$rangeStart = $parsedDay # Defaults to midnight
$rangeEnd = $parsedDay.AddHours(23).AddMinutes(59).AddSeconds(59) # End of the same day
}
}
}
catch
{
# Record any errors and return false by default
Write-Output "`tWARNING: Exception encountered while parsing time range. Details: $($_.Exception.Message). Check the syntax of entry, e.g. ' -> ', or days/dates like 'Sunday' and 'December 25'"
return $false
}

# Check if current time falls within range
if($currentTime -ge $rangeStart -and $currentTime -le $rangeEnd)
{
return $true
}
else
{
return $false
}

} # End function Test-ScheduleEntry


# Function to handle power state assertion for resources
function Assert-ResourcePowerState
{
param(
[Parameter(Mandatory=$true)]
[object]$Resource,
[Parameter(Mandatory=$true)]
[string]$DesiredState,
[bool]$Simulate
)

$processor = $ResourceProcessors | Where-Object ResourceType -eq $Resource.ResourceType
if(-not $processor) {
throw ('Unable to find a resource processor for type ''{0}''. Resource: {1}' -f $Resource.ResourceType, ($Resource | ConvertTo-Json -Depth 5000))
}
# If should be started and isn't, start resource
$currentPowerState = & $processor.PowerStateAction -Resource $Resource -DesiredState $DesiredState
if($DesiredState -eq 'Started' -and $currentPowerState -notmatch 'Started|Starting|running')
{
if($Simulate)
{
Write-Output "`tSIMULATION -- Would have started resource. (No action taken)"
}
else
{
Write-Output "`tStarting resource"
& $processor.StartAction -ResourceId $Resource.ResourceId
}
}

# If should be stopped and isn't, stop resource
elseif($DesiredState -eq 'StoppedDeallocated' -and $currentPowerState -notmatch 'Stopped|deallocated')
{
if($Simulate)
{
Write-Output "`tSIMULATION -- Would have stopped resource. (No action taken)"
}
else
{
Write-Output "`tStopping resource"
& $processor.DeallocateAction -ResourceId $Resource.ResourceId
}
}

# Otherwise, current power state is correct
else
{
Write-Output "`tCurrent power state [$($currentPowerState)] is correct."
}
}

# Main runbook content
try
{
$currentTime = GetCurrentDate
Write-Output "Runbook started. Version: $VERSION"
if($Simulate)
{
Write-Output '*** Running in SIMULATE mode. No power actions will be taken. ***'
}
else
{
Write-Output '*** Running in LIVE mode. Schedules will be enforced. ***'
}
Write-Output "Current UTC/GMT time [$($currentTime.ToString('dddd, yyyy MMM dd HH:mm:ss'))] will be checked against schedules"


$Conn = Get-AutomationConnection -Name AzureRunAsConnection
$resourceManagerContext = Add-AzureRMAccount -ServicePrincipal -Tenant $Conn.TenantID -ApplicationId $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint

$resourceList = @()
# Get a list of all supported resources in subscription
$ResourceProcessors | % {
Write-Output ('Looking for resources of type {0}' -f $_.ResourceType)
$resourceList += @(Find-AzureRmResource -ResourceType $_.ResourceType)
}

$ResourceList | % {
if($_.Tags -and $_.Tags.ContainsKey($autoShutdownOrderTagName) ) {
$order = $_.Tags | % { if($_.ContainsKey($autoShutdownOrderTagName)) { $_.Item($autoShutdownOrderTagName) } }
} else {
$order = $defaultOrder
}
Add-Member -InputObject $_ -Name ProcessingOrder -MemberType NoteProperty -TypeName Integer -Value $order
}

$ResourceList | % {
if($_.Tags -and $_.Tags.ContainsKey($autoShutdownDisabledTagName) ) {
$disabled = $_.Tags | % { if($_.ContainsKey($autoShutdownDisabledTagName)) { $_.Item($autoShutdownDisabledTagName) } }
} else {
$disabled = '0'
}
Add-Member -InputObject $_ -Name ScheduleDisabled -MemberType NoteProperty -TypeName String -Value $disabled
}

# Get resource groups that are tagged for automatic shutdown of resources
$taggedResourceGroups = Find-AzureRmResourceGroup -Tag @{ "AutoShutdownSchedule" = $null }
$taggedResourceGroupNames = @($taggedResourceGroups | select Name)

Write-Output "Found [$($taggedResourceGroupNames.Count)] schedule-tagged resource groups in subscription"

if($DefaultScheduleIfNotPresent) {
Write-Output "Default schedule was specified, all non tagged resources will inherit this schedule: $DefaultScheduleIfNotPresent"
}

# For each resource, determine
# - Is it directly tagged for shutdown or member of a tagged resource group
# - Is the current time within the tagged schedule
# Then assert its correct power state based on the assigned schedule (if present)
Write-Output "Processing [$($resourceList.Count)] resources found in subscription"
foreach($resource in $resourceList)
{
$schedule = $null

if ($resource.ScheduleDisabled)
{
$disabledValue = $resource.ScheduleDisabled
if ($disabledValue -eq "1" -or $disabledValue -eq "Yes"-or $disabledValue -eq "True")
{
Write-Output "[$($resource.Name)]: `r`n`tIGNORED -- Found direct resource schedule with $autoShutdownDisabledTagName value: $disabledValue."
continue
}
}

# Check for direct tag or group-inherited tag
if($resource.Tags.Count -gt 0 -and $resource.Tags.ContainsKey($autoShutdownTagName) -eq $true)
{
# Resource has direct tag (possible for resource manager deployment model resources). Prefer this tag schedule.
$schedule = $resource.Tags.Item($autoShutdownTagName)
Write-Output "[$($resource.Name)]: `r`n`tADDING -- Found direct resource schedule tag with value: $schedule"
}
elseif($taggedResourceGroupNames -contains $resource.ResourceGroupName)
{
# resource belongs to a tagged resource group. Use the group tag
$parentGroup = $resourceGroups | Where-Object Name -eq $resource.ResourceGroupName
$schedule = $parentGroup.Tags.Item($AUTOSHUTDOWNSCHEDULE_KEYWORD)
Write-Output "[$($resource.Name)]: `r`n`tADDING -- Found parent resource group schedule tag with value: $schedule"
}
elseif($DefaultScheduleIfNotPresent)
{
$schedule = $DefaultScheduleIfNotPresent
Write-Output "[$($resource.Name)]: `r`n`tADDING -- Using default schedule: $schedule"
}
else
{
# No direct or inherited tag. Skip this resource.
Write-Output "[$($resource.Name)]: `r`n`tIGNORED -- Not tagged for shutdown directly or via membership in a tagged resource group. Skipping this resource."
continue
}

# Check that tag value was succesfully obtained
if($schedule -eq $null)
{
Write-Output "[$($resource.Name) `- $($resource.ProcessingOrder)]: `r`n`tIGNORED -- Failed to get tagged schedule for resource. Skipping this resource."
continue
}

# Parse the ranges in the Tag value. Expects a string of comma-separated time ranges, or a single time range
$timeRangeList = @($schedule -split ',' | foreach {$_.Trim()})

# Check each range against the current time to see if any schedule is matched
$scheduleMatched = $false
$matchedSchedule = $null
$neverStart = $false #if NeverStart is specified in range, do not wake-up machine
foreach($entry in $timeRangeList)
{
if((Test-ScheduleEntry -TimeRange $entry) -eq $true)
{
$scheduleMatched = $true
$matchedSchedule = $entry
break
}

if ($entry -eq "NeverStart")
{
$neverStart = $true
}
}
Add-Member -InputObject $resource -Name ScheduleMatched -MemberType NoteProperty -TypeName Boolean -Value $scheduleMatched
Add-Member -InputObject $resource -Name MatchedSchedule -MemberType NoteProperty -TypeName Boolean -Value $matchedSchedule
Add-Member -InputObject $resource -Name NeverStart -MemberType NoteProperty -TypeName Boolean -Value $neverStart
}

foreach($resource in $resourceList | Group-Object ScheduleMatched) {
if($resource.Name -eq '') {continue}
$sortedResourceList = @()
if($resource.Name -eq $false) {
# meaning we start resources, lower to higher
$sortedResourceList += @($resource.Group | Sort ProcessingOrder)
} else {
$sortedResourceList += @($resource.Group | Sort ProcessingOrder -Descending)
}

foreach($resource in $sortedResourceList)
{
# Enforce desired state for group resources based on result.
if($resource.ScheduleMatched)
{
# Schedule is matched. Shut down the resource if it is running.
Write-Output "[$($resource.Name) `- P$($resource.ProcessingOrder)]: `r`n`tASSERT -- Current time [$currentTime] falls within the scheduled shutdown range [$($resource.MatchedSchedule)]"
Add-Member -InputObject $resource -Name DesiredState -MemberType NoteProperty -TypeName String -Value 'StoppedDeallocated'

}
else
{
if ($resource.NeverStart)
{
Write-Output "[$($resource.Name)]: `tIGNORED -- Resource marked with NeverStart. Keeping the resources stopped."
Add-Member -InputObject $resource -Name DesiredState -MemberType NoteProperty -TypeName String -Value 'StoppedDeallocated'
}
else
{
# Schedule not matched. Start resource if stopped.
Write-Output "[$($resource.Name) `- P$($resource.ProcessingOrder)]: `r`n`tASSERT -- Current time falls outside of all scheduled shutdown ranges. Start resource."
Add-Member -InputObject $resource -Name DesiredState -MemberType NoteProperty -TypeName Boolean -Value 'Started'
}
}
Assert-ResourcePowerState -Resource $resource -DesiredState $resource.DesiredState -Simulate $Simulate
}
}

Write-Output 'Finished processing resource schedules'
}
catch
{
$errorMessage = $_.Exception.Message
throw "Unexpected exception: $errorMessage"
}
finally
{
Write-Output "Runbook finished (Duration: $(('{0:hh\:mm\:ss}' -f ((GetCurrentDate) - $currentTime))))"
}

Microsoft Dynamics Webcasts, October 23-27, 2017: D365 doc management; AWS for ISVs; Sales Navigator lead gen; Migrating AX, NAV, GP, SL to cloud

$
0
0
Here's what's happening on this week's live webcast schedule. Register to attend live or get access to the recorded event. Tuesday, October 24, 2017 Solve Document Challenges and Improve Customer Engagement with Xpertdoc and ...read more

Subscription Billing for AX (Mass Archive/Billing Schedule)

$
0
0

Did You Know...

To archive several billing schedules simultaneously, use the Mass Archive Process form found through Modules > Advanced Recurring Contract Billing> Periodic tasks > Mass archive process.

To archive a billing schedule (process):

  1. Specify the Billing end date
  2. If you want to further restrict the records that appear in the line grid, click select to add other criteria to restrict the records.
  3. Select any records you do not want to archive, and click remove.
  4. Click OK.

If you just want to archive a single schedule, use the Billing Schedule form.

For GP, follow a similar procedure except using the Archive Billing Schedule Utility form located through Tools > Utilities >Adv. Recurring Contract Billing> Archive schedule.

 

Written by Scott Pledger, Binary Stream Software

 

 

Microsoft updates Dynamics AX users on D365 Finance & Operations Enterprise on-prem, hybrid plans

$
0
0
Orchestrating development in a D365 on-prem deployment |  Source Microsoft continues to firm up the on-premises and hybrid ("Cloud + Edge") models for deploying and running Dynamics 365 for Finance and Operations, Enterprise edition ...read more

How to generate general ledger vouchers using Data Entities and X++ in Dynamics 365 For Operations

$
0
0
I had a requirement to generate ledger vouchers programmatically in Dynamics 365 for Operations. Since AxdClasses were removed, and Data entities came into picture, I thought of using them to achieve my...(read more)

X++ code to import multiple file from a folder in AX 2012 R3

$
0
0
X++ code to import multiple files from a folder in AX 2012 R3 Create a Runbase class : class RBReadFileFromDirectory extends RunBaseBatch { Filename ItemFileName; Filename filename; DialogField dialogFilename;...(read more)

High Availability AX 2012 Links

Reporting in Dynamics 365 for Finance and Operations – The definitive guide

$
0
0
I read a lot of different posts about how to connect to Dynamics 365 for Finance and Operations (I’m shortening this down to D365FO throughout this post) for reporting and there seems to be somewhat...(read more)

D365: License configuration form is read-only unless the system is in the maintenance mode

$
0
0
Hi All, Today i wanted to which i faced recently - i.e. as we remember the configuration keys - for enable & disable the functionality in Dynamics. In D365 i was trying to enable few functionality...(read more)

Table browser in Dynamics 365

$
0
0
Normally when I need the table browser in Dynamics 365 I use a Chrome extension called “ Table Browser Caller for D365FO “. But when working with a variety of environments with different AAD...(read more)

Microsoft Management Report installation, configuration links Dynamics Ax 2012 R3

$
0
0

Couple of days ago, I configure the Management Report on client machine. I found following links helps to install and reconfigure.

 

You can download Microsoft Management Report integration guide from here. It was last updated Feb 2017

https://www.microsoft.com/en-us/download/details.aspx?id=5916

 

For me the most important thing I found is user role in white paper.

 

 

https://www.microsoft.com/en-us/download/details.aspx?id=5916

 

A lot of useful time from My fellow MVP to Tommy Skaue

http://yetanotherdynamicsaxblog.blogspot.com/2013/12/installation-of-management-reporter.html

 

http://yetanotherdynamicsaxblog.blogspot.com/2014/03/adding-users-in-management-reporter.html

 

 

Form Important post from Kaya Consultancy

https://kaya-consulting.com/management-reporter/

https://kaya-consulting.com/troubleshooting-management-reporter-integration-with-ax-2012/

 

Some other links

 

http://www.crestwood.com/blog/view/back-to-basics-create-a-new-user-in-management-reporter/

http://www.uxceclipse.com/how-to-rebuild-datamart-ddm-for-management-reporter-2012-in-microsoft-dynamics-erp/

 

http://www.everythingdynamicsaxbi.com/2016/02/01/management-reporter-rebuilding-your-data-mart/

 

Dr. Ludwig Reinhardz

 

 

https://dynamicsax-fico.com/2017/01/20/link-multiple-management-reporter-reports/

https://dynamicsax-fico.com/2015/12/03/management-reporter-reports-based-on-different-chart-of-accounts/

https://dynamicsax-fico.com/2016/09/18/management-reporter-unit-security/

https://dynamicsax-fico.com/2015/12/03/management-reporter-reports-based-on-different-chart-of-accounts/

https://dynamicsax-fico.com/2015/11/23/management-reporter-excel-import/

https://dynamicsax-fico.com/2015/03/01/switching-accounts/

 

Microsoft Q1 2018 Earnings Release: Revenue exceeds market expectations, handily

$
0
0
Microsoft has released the following results for the quarter ended September 30, 2017: Revenue was $24.5 billion and increased 12% Operating income was $7.7 billion and increased 15% Net income was $6.6 billion and increased ...read more

Chain of Command–next() gotcha

$
0
0

Be careful when using Chain of Command not to place the next() call in a condition.

Here is an example.

Create a class extension for a form. Call the method init() but place it in an “if” condition. Something like this.

public void init()
{
  if (this.args() && this.args().record())
  {
    //do something before

    next init(); //this is inside the “if” condition

    //do something after
  }
}

The compiler will not error or give you a warning. However, at run time you will get a misleading error.

In my case I got this. “Error executing code: Wrong argument type for function.”

image

Having a look at Event viewer (Folder: AX-XppRuntime), it gave me a little more info. At least I know the class that was calling it. I searched for any customization.

image

I found an extension class PurchReqCreate_Extension. I was able to eye ball and figure out the problem. Taking next() outside the “if” condition.

Rewrote the same:

public void init()
{
  if (this.args() && this.args().record())
  {
    //
do something before
  }

  next init();

  if (this.args() && this.args().record())
  {
    //
do something after
  }

}


How to generate and populate data to word documents using OpenXML and X++ in Dynamics 365 for Operations

$
0
0
I was lately trying to find a better and easier way to populate data to word documents from Microsoft Dynamics AX to Word documents, instead of using bookmarks. I experimented OpenXML library and got...(read more)

Recurring Integrations Scheduler: File already exists

$
0
0

I’ve recently run into a problem with Recurring Integrations Scheduler and I think I won’t be the only one, therefore I’m going to explain it here.

The Recurring Integrations Scheduler (RIS) supports both the old recurring integrations API (enqueue/dequeue) and the new package API, which is the recommended approach. With the package API, you can either import whole packages (which you must prepare by yourself in some way) or you can give RIS actual data files (XML, CSV…) and let it build packages for you. That’s the scenario I’m talking about below.

If you want RIS to create packages, you must give it a package template. Go to the Data Management workspace in AX 7, create an import job, configure it as you like and then download the package. I’m using the Customer groups entity as an example.

You’ll get a file with a GUID as the name, such as {99DD43E4-936E-4402-80E6-1477013A5275}.zip. Feel free to rename it; I’ll call it CustGroupImportTemplate.zip.

This is its content:

You can see one data file for the entity (Customer groups.xml in my case) plus some metadata defining the import project.

It’s not exactly what’s needed, as we’ll see later, but let’s continue for now with this package.

Go to RIS and configure an import job. Don’t forget to set Package template to the package file.

Make sure the job is running, create an input file in the right format and put it into the input folder.

Unfortunately the import fails and you’ll find these files in the Processing errors folder:

The status file merely says that StatusCode = BadRequest and events logs for RIS (Applications and Services Logs > Recurring Integrations Scheduler) don’t reveal anything else either. More useful event logs are under Applications and Services Logs > Microsoft > Dynamics > AX-OData Service, where you can find something like this:

System.InvalidOperationException: Exception occurred while executing action ImportFromPackage on Entity DataManagementDefinitionGroup: The file ‘C:\windows\TEMP\005DE7CC-C7E8-410D-8690-7A63C30224BF_FF5EE0BE-205C-48BC-8987-96C007CE74ED\Customer groups.xml’ already exists.

A unique folder name is generated for each import, therefore the problem isn’t related to existing files in the Temp folder.

To make it short, the problem is in the package file itself, which you unfortunately never see, because it’s automatically deleted on failure. If you captured it and looked inside, you would find this:

There are literally two files with the same name and therefore the attempt to unpack the archive fails on the second instance.

How does this happen?

One file is coming from the package template. The other is the input file, which RIS renamed to match the entity name and added to the archive. Having files with same names is supported by ZIP, but the library used by RIS for unpacking isn’t able to handle it.

To get it working correctly, you must remove the data file (Customer groups.xml) from the package used as a template. A better solution, though, would be modifying RIS to replace the file instead of attaching another file with the same name.

Errors when trying to generate a forecast using Demand Forecasting (AX2012)

$
0
0
I was setting up Ax2012R3 to use the Demand Forecasting functionality and it wasn’t that straightforward as I thought. I began deploying the Demand Forecast database from SQL Server Analysis Services...(read more)

Could not upload to the storage location Dynamics 365 for finance and operations.

$
0
0

I was experimenting with Office integration in Dynamics 365 for finance and operations. On Create Excel worksheet. I got following error

Could not upload to the storage location: Unable to connect to the remote server.

Later I found that on my onbox, Azure Emulator was not running.

So I did

  1. On OneBox VM, run command prompt as administrator.
  2. Navigate to “C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\”
  3. Run “AzureStorageEmulator.exe start”

After running that service, Download options perfectly worked

Mass delete records D365 for Finance and Operations.

$
0
0

I was testing one scenario, I have created some main account wrongly. So I want to delete them quickly.

Secondly I want to explore the Office integration In D365 for finance and operations.

So I did following steps to delete the required records quickly.

 Organization administration > Setup > Office integration > Excel workbook designer

 

Select entity “MainAccount”

. Create workbook

and download it

Login in Excel

Open excel

Delete selected records

Publish

Confirm.

Records are successfully deleted.

Viewing all 17314 articles
Browse latest View live