Friday, April 17, 2015

The field has an invalid XAML formula definition - Rollup field

Issue resolution

Recently came across an interesting issue from one of my colleagues, when he tried to create a rollup field, a message is telling that XAML formula definition for rollup field is invalid. 




A little tracing and checking made me suspect that he did something wrong on creating the rollup field, and I was a bit surprised!

So what is the best way to resolve it?

By using MSSQL profiler I got that the relationship schema name for the parent and child entities was too long.





After researching a little bit, I found that the schema name and logical name for custom entities, attributes, relationships and for many-to-many relationship intersect tables have a maximum length of 50 characters.


Hope it helps!

10 comments:

  1. Hi Abed! I am having this problem and not sure exactly how to fix it... Could you give more details? Should I delete the field and create another one with the same schema name?

    ReplyDelete
    Replies
    1. Hello Elivis,

      First make sure that your current field schema name is not longer than 50 characters, if yes then you need to delete the field and create a new one with schema name which is not longer than 50 characters :)

      Delete
    2. Hello Abed
      so in case if no what i will do?

      Delete
    3. Hello Hani,
      You can use MSSQL profiler to trace the issue, or use MS Dynamics CRM tracer.
      Use this tool to enable CRM tracer :
      https://crmdiagtool2011.codeplex.com/

      and this tool to easily read the trace file :
      https://crmtracereader.codeplex.com/

      Delete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Hi Abed!

    Im experiencing this in CRM 2016 Online. Do you why? I've tried the 'Copy' functionality of O365 of PROD to TEST.

    Cheers,
    Junyet

    ReplyDelete
  4. did you check the schema name and logical name for custom entities, attributes, relationships and for many-to-many ?
    Also set the scope of your business rules to "Entity" before export the solution :)

    ReplyDelete
  5. I had the same issue except in my case it was trying to insert New_entitynamexxxx that was 37 characters into the field RollupEntityBaseTableName which is nvarchar(32). Opening support case with Microsoft.

    ReplyDelete
  6. I experienced the same error ("XAML formula definition for rollup field is invalid") whilst amending an existing rollup field. It seems that this error often masks other problems, in my case it was a SQL timeout that was the true issue. The timeout was caused by the rollup modifying AsyncOperationBase, adding a new index sorted this:

    CREATE NONCLUSTERED INDEX IX_RecurrencyCorrelationId
    ON [dbo].[AsyncOperationBase] ([RecurrencePattern],[CorrelationId])
    INCLUDE ([StatusCode],[AsyncOperationId],[StateCode])

    ReplyDelete
  7. Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
    Best CRM System

    ReplyDelete

Unexpected Error When Replying or Forwarding an Email

Recently came across an interesting issue from one of my clients, they were working fine since around 2 years ago with no issues, using Dyn...