web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

DMF REST API ExportToPackage. Data project does not exist.

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I'm trying to use the REST API to export a package but I keep getting the response back that the package does not exist. The package exists within D365 and I can run it manually. 

POST /data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ExportToPackage

{
    "definitionGroupId":"TEST_Package",
    "packageName": "test.zip",
    "executionId": "",
    "reExecute": true,
    "legalEntityId": "ENT"
}

Response:

{
    "error": {
        "code": "",
        "message": "An error has occurred.",
        "innererror": {
            "message": "Exception occurred while executing action ExportToPackage on Entity DataManagementDefinitionGroup: Data project TEST_Package does not exist.",
            "type": "System.InvalidOperationException",
            "stacktrace": "   at Microsoft.Dynamics.Platform.Integration.Services.OData.Action.ActionInvokable.Invoke()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.ActionInvocation(ChangeOperationContext context, ActionInvokable action)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.<>c__DisplayClass19_0.<ScheduleInvokable>b__0(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActions(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__3.MoveNext()",
            "internalexception": {
                "message": "Exception has been thrown by the target of an invocation.",
                "type": "System.Reflection.TargetInvocationException",
                "stacktrace": "   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Action.ActionInvokable.Invoke()",
                "internalexception": {
                    "message": "Data project TEST_Package does not exist.",
                    "type": "Microsoft.Dynamics.Ax.Xpp.ErrorException",
                    "stacktrace": "   at Dynamics.AX.Application.DataManagementDefinitionGroupEntity.`ExportToPackageInternal(String definitionGroupId, String packageName, String executionId, Boolean reExecute, String legalEntityId, TelemetryRuntimeDuration telemetry) in xppSource://Source/ApplicationFoundation\\AxDataEntityView_DataManagementDefinitionGroupEntity.xpp:line 163\r\n   at Dynamics.AX.Application.DataManagementDefinitionGroupEntity.ExportToPackageInternal(String definitionGroupId, String packageName, String executionId, Boolean reExecute, String legalEntityId, TelemetryRuntimeDuration telemetry)\r\n   at Dynamics.AX.Application.DataManagementDefinitionGroupEntity.`ExportToPackage(String definitionGroupId, String packageName, String executionId, Boolean reExecute, String legalEntityId) in xppSource://Source/ApplicationFoundation\\AxDataEntityView_DataManagementDefinitionGroupEntity.xpp:line 229\r\n   at Dynamics.AX.Application.DataManagementDefinitionGroupEntity.ExportToPackage(String definitionGroupId, String packageName, String executionId, Boolean reExecute, String legalEntityId)"
                }
            }
        }
    }
}
I have the same question (0)
  • AnithaEswaran Profile Picture
    2,032 on at

    Hi,

    Can you check the default company of 'Admin' user.  Is it pointing to the company you are using. If not, either change to this company or include 'Cross-company' in the API call

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans