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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Solution import error

(0) ShareShare
ReportReport
Posted on by 239

I made a full copy of a sandbox instance to create a Test instance.

The Dev instance has a Solution = Sample1(Unmanaged).

I added a new entity to this solution and some fields/form edits and trying to import in Test instance.

But getting an error while import which isnt related to the new entity added but Case entity.

Here's the error that I am getting(The field it is complaining about is a DateTime field (Calculated)):

An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365 Administrator. Finally, you can contact Microsoft Support. : Microsoft.Crm.CrmException: You can only use a Date Only type of field.    at Microsoft.Crm.Workflow.Utils.SharedUtility.ThrowException(ErrorCode code, Object[] args)    at Microsoft.Crm.Workflow.Validators.SetAttributeValueStepValidator.ValidateAssignmentApplicability(ExpressionBase expression)    at Microsoft.Crm.ObjectModel.Validations.CalculatedFieldValidationVisitor.VisitConditionStep(ConditionStep conditionStep)    at Microsoft.Crm.ObjectModel.Validations.CalculatedFieldValidationVisitor.VisitWorkflowStep(WorkflowStep workflowStep)    at Microsoft.Crm.Metadata.AttributeService.ValidateFormulaDefinitionContentBySourceType(AttributeDescriptionPropertyBag attribute, WorkflowStep formula, ExecutionContext context, Boolean ignoreInvalidAttributes)    at Microsoft.Crm.Metadata.AttributeService.ProcessSourceTypeRules(AttributeInfo attributeInfo, MetadataBusinessEntity existingAttributeData, ExecutionContext context)    at Microsoft.Crm.Metadata.AttributeService.ValidateForUpdate(AttributeInfo attributeInfo, MetadataBusinessEntity existingAttributeData, Boolean isSystemAttributeCreate, ExecutionContext context, MetadataHelper metadataHelper)    at Microsoft.Crm.Metadata.AttributeService.<>c__DisplayClass80_0.<UpdateInternal>b__0()    at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)    at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)    at Microsoft.Crm.Metadata.AttributeService.UpdateNoPrivilegeChecks(Guid attributeId, AttributeInfo attributeInfo, ExecutionContext context, MetadataHelper metadataHelper, Boolean mergeLabels)    at Microsoft.Crm.Metadata.AttributeService.Update(Guid attributeId, AttributeInfo attributeInfo, Boolean mergeLabels, MetadataHelper metadataHelper, ExecutionContext context)    at Microsoft.Crm.Tools.ImportExportPublish.ImportCalculatedFieldHandler.ImportItem()

*This post is locked for comments

I have the same question (0)
  • PragmaticDevs Profile Picture
    239 on at
    RE: Solution import error

    I am using Unmanaged solutions (Both instances have unmanaged solutions)

    If the field had any dependencies, wouldn't it warn me before deletion (However I am sure there were no dependencies).

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Solution import error

    Hi,

    What type of solution are you importing ,is it managed or unmanaged ?

    I think still some dependent resources are there in your source instance  , try to check if anything you find in your source instance. Did you check dependencies  before  delete the fields or are you aware any dependencies ?

    If you are using managed solution then do following steps might be helps you-

    - Clone solution and give new version.

    - Import solution to your target instance, in the import window choose stage for upgrade and overwrite customization.

    - Once import done , click on apply solution upgrade.

  • PragmaticDevs Profile Picture
    239 on at
    RE: Solution import error

    Hi Prashant,

    The calculated field's action had some issue, I couldnt save the field with same action in Source instance. So now I deleted the calculated field in question from both Dev(Source) and Test Instance (Target which was created using full copy).

    Now I get the following error:

    Microsoft.Crm.CrmException: Exception while executing the query:insert into DependencyBase(DependencyId, RequiredComponentNodeId, DependencyType, DependentComponentNodeId) select DependencyId, RequiredComponentNodeId, DependencyType, DependentComponentNodeId from @bulkInsertTable ---> System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.DependencyBase' with unique index 'ndx_UniqueDependencyNodes'. The duplicate key value is (f6b41023-89fc-4efe-9d24-b5d8af70c580, 0c592a9c-e544-47f5-8283-65210c46e22a). The statement has been terminated.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

    I also created a patch solution in Dev and included just new changes and tried importing in Target, it successfully imported. I am still confused why the Base customization solution (which exisits in both instances) isnt importing after deleting the calculated field now.

    Any suggestions?

  • Verified answer
    Prashant_ Profile Picture
    1,040 on at
    RE: Solution import error

    You had created new calculated date time field.error code mentioned in screen is related to it. following link will help you understand what error encounter by its code.

    docs.microsoft.com/.../web-service-error-codes

    I searched your error code and I found following result.

    Name: CalculatedFieldsInvalidValues

    Hex: 80060430

    Number: -2147089360 The formula references the following values that don't exist: {0}.

    It means you didn't created rule for your calculated field.

  • PragmaticDevs Profile Picture
    239 on at
    RE: Solution import error

    Yes its the same solution, I just added a new entity (a very simple one with 1 field) and added this entity as lookup on Incident.

    3365.2019_2D00_03_2D00_22-10_5F00_48_5F00_50_2D00_Import-Solution.png

    Log message:

    An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365 Administrator. Finally, you can contact Microsoft Support. : Microsoft.Crm.CrmException: You can only use a Date Only type of field.    at Microsoft.Crm.Workflow.Utils.SharedUtility.ThrowException(ErrorCode code, Object[] args)    at Microsoft.Crm.Workflow.Validators.SetAttributeValueStepValidator.ValidateAssignmentApplicability(ExpressionBase expression)    at Microsoft.Crm.ObjectModel.Validations.CalculatedFieldValidationVisitor.VisitConditionStep(ConditionStep conditionStep)    at Microsoft.Crm.ObjectModel.Validations.CalculatedFieldValidationVisitor.VisitWorkflowStep(WorkflowStep workflowStep)    at Microsoft.Crm.Metadata.AttributeService.ValidateFormulaDefinitionContentBySourceType(AttributeDescriptionPropertyBag attribute, WorkflowStep formula, ExecutionContext context, Boolean ignoreInvalidAttributes)    at Microsoft.Crm.Metadata.AttributeService.ProcessSourceTypeRules(AttributeInfo attributeInfo, MetadataBusinessEntity existingAttributeData, ExecutionContext context)    at Microsoft.Crm.Metadata.AttributeService.ValidateForUpdate(AttributeInfo attributeInfo, MetadataBusinessEntity existingAttributeData, Boolean isSystemAttributeCreate, ExecutionContext context, MetadataHelper metadataHelper)    at Microsoft.Crm.Metadata.AttributeService.<>c__DisplayClass80_0.<UpdateInternal>b__0()    at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)    at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)    at Microsoft.Crm.Metadata.AttributeService.UpdateNoPrivilegeChecks(Guid attributeId, AttributeInfo attributeInfo, ExecutionContext context, MetadataHelper metadataHelper, Boolean mergeLabels)    at Microsoft.Crm.Metadata.AttributeService.Update(Guid attributeId, AttributeInfo attributeInfo, Boolean mergeLabels, MetadataHelper metadataHelper, ExecutionContext context)    at Microsoft.Crm.Tools.ImportExportPublish.ImportCalculatedFieldHandler.ImportItem()

  • Prashant_ Profile Picture
    1,040 on at
    RE: Solution import error

    This  is strange because this error  clearly related to behavior of Calculated  date time field.Can you share more information about this error and what changes you did ? Also did you tried to import same solution in other demo environment?

  • PragmaticDevs Profile Picture
    239 on at
    RE: Solution import error

    Hi Prashant,

    No change was made to the field, infact I just created a full copy of the instance and there's no difference between the 2 instances.

    I also compared the field definition in both environments and its the same.

  • Suggested answer
    Prashant_ Profile Picture
    1,040 on at
    RE: Solution import error

    This error occur when you change calculated date time field behavior from Date Only to Date Time or vice versa.Make sure restore changes you had  done on calculated date time field or if you want to change fields behavior then delete it and recreate as per you required behaviour.  

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans