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 :
Microsoft Dynamics CRM (Archived)

Solved:Workflow error: character limit in text field

(0) ShareShare
ReportReport
Posted on by

I am running into an issue with a workflow inserting data from other fields.  On the Task Entity the Subject field has a limit of 450 characters and cannot be adjusted any higher due to the type of text field it is.  When I run a workflow to create a task and insert data from a few other fields in the Subject I receive this error: You have exceeded the maximum number of {0} characters in this field.  So I decided to check the character count of the field if it was to put the requested data in the field and it is only 144 characters.  Then, I took it a step further and manually typed the info in the Subject on Task create step and it works with no issue.  So my question is, why is it treating this as more than 450 characters when using the workflow to dynamically insert the data?  Does the workflow insert extra characters when doing this and if so how many per lookup because it must be adding at least 300+ characters for it to cause this error?

Here is the Subject text and the Workflow syntax to insert the data:

Workflow TEST ACCOUNT has ordered the Social Media Marketing - Essential Package on Facebook/Instragram/Twitter/Pinterest/LinkedIn for 12 Months

I know there is a workaround by creating a new field, change the type to text area and copy the data to new field with a workflow but, I have over a half a million tasks in the system and over 250 workflows that depend on the field.  Not something I plan on doing any time soon.  Any suggestions would be greatly appreciated on how to get around this without having to manually set up for each combination of selected networks.

A little more info on the logic used.

there are 5 networks to choose from

each network field is setup as two options(yes/no) with "no" set as default

the form displays the fields as checkbox

workflow checks each network if "yes" appends network name in field "Selected SM Posting Networks"

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    what if you test the workflow by directly update the field with the text provided above. I am suspecting something wrong with your code.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Does it happening for particular record or all record ?

    Are you sure that the same field is creating problem . It might happen some other field exceeding limits .

    In  addition please  check you you have set the field length correctly .

  • Community Member Profile Picture
    on at

    Sorry, you might have missed it in the explanation "Then, I took it a step further and manually typed the info in the Subject on Task create step and it works with no issue.".

    But I did try putting the text in manually and that works fine, which makes me think that when updating dynamically using other fields it is adding extra characters.  But an extra 300+ character seems excessive.  I am in no way an expert with CRM workflows but have been creating them since CRM 4.0 and have never ran into this issue.

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    lets share your code here.

  • Community Member Profile Picture
    on at

    No code being used only the workflow builder.

    This works:

    not-working.PNG

    This does not:

    not-working.PNG

    here is the error details from the system job:

    Unhandled exception:
    Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
    Message: A validation error occurred.  The length of the 'subject' attribute of the 'task' entity exceeded the maximum allowed length of '450'.Detail:
    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
      <ActivityId>ebc436ac-f7ba-472c-862d-26cee7056f92</ActivityId>
      <ErrorCode>-2147204303</ErrorCode>
      <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiExceptionSourceKey</d2p1:key>
          <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.ObjectModel.TargetAttributeValidationPlugin</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiOriginalExceptionKey</d2p1:key>
          <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Microsoft.Crm.ObjectModel.CrmStringAttributeValidationException: A validation error occurred.  The length of the 'subject' attribute of the 'task' entity exceeded the maximum allowed length of '450'. ---&gt; Microsoft.Crm.ObjectModel.CrmStringAttributeValidationException: A validation error occurred.  The length of the 'subject' attribute of the 'task' entity exceeded the maximum allowed length of '450'.
       at Microsoft.Crm.ObjectModel.StringAttributeValidator.Validate(Entity entity, KeyValuePair`2 property, AttributeMetadata attributeMetadata, ExecutionContext platformContext)
       at Microsoft.Crm.ObjectModel.AttributeValidationPlugin.PerformValidation(Entity entity, EntityMetadata entityMetadata, ExecutionContext platformContext, Entity parentEntity)
       at Microsoft.Crm.ObjectModel.AttributeValidationPlugin.Execute(IServiceProvider serviceProvider)
       at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiStepKey</d2p1:key>
          <d2p1:value xmlns:d4p1="schemas.microsoft.com/.../Serialization" i:type="d4p1:guid">fc743e7d-fbea-4695-bdb9-7d78334c8474</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiDepthKey</d2p1:key>
          <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:int">2</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiActivityIdKey</d2p1:key>
          <d2p1:value xmlns:d4p1="schemas.microsoft.com/.../Serialization" i:type="d4p1:guid">ebc436ac-f7ba-472c-862d-26cee7056f92</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiPluginSolutionNameKey</d2p1:key>
          <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>ApiStepSolutionNameKey</d2p1:key>
          <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    could you reupload the picture?

    choose "use rich formatting" and select upload media.

  • Community Member Profile Picture
    on at

    was doing that when you posted, images are added.  thanks.

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    can you use stop workflow with cancelled status, and putting the same dynamics value into the worfklow error message?

    Lets see the final result.

  • Community Member Profile Picture
    on at

    I am assuming you meant to add the Stop Workflow step and set it to Cancelled, directly after the task create step.  I did that and get the same result, had to create a new workflow because there were steps after and it would not let me save the workflow.  The status of the workflow is waiting and the same error.

    A validation error occurred.  The length of the 'subject' attribute of the 'task' entity exceeded the maximum allowed length of '450'.

  • Community Member Profile Picture
    on at

    [quote user="Goutam Das"]

    Hi,

    Does it happening for particular record or all record ?

    Are you sure that the same field is creating problem . It might happen some other field exceeding limits .

    In  addition please  check you you have set the field length correctly .

    [/quote]

    All records that I run the workflow against.  The error specifically says it is the subject field

    A validation error occurred.  The length of the 'subject' attribute of the 'task' entity exceeded the maximum allowed length of '450'.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans