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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

While Creating The Notes Entity using Plugin -Facing issue

(0) ShareShare
ReportReport
Posted on by 95

Hi Team,

Please help to resolve this issue:

"Error in line 1 position 408. Element 'schemas.datacontract.org/.../System.Collections.Generic:value'
contains data from a type that maps to the name 'System:ValueTuple`2'.
The deserializer has no knowledge of any type that maps to this name.
Consider changing the implementation of the ResolveName method on your
DataContractResolver to return a non-null value for name 'ValueTuple`2' and namespace 'System'."

I tried to create Email attachment to Notes Entity using Plugin but am facing the above issue 

in this Line

Entity entity = new Entity("annotation");
entity["subject"]=("subject", "Attachment from email: " + context.GetString(email, "subject", ""));
entity["isdocument"] =true;
entity["filename"] =current["filename"];
entity["documentbody"] = current["body"];
entity["objectid"] = entityRef; -- this is for Incident entity ID

//entity["ownerid"]= context.Retrieve(entityRef, columnNames, false).GetAttributeValue<EntityReference>("ownerid");

entity.Attributes.Add("ownerid", context.Retrieve(entityRef, columnNames, false).GetAttributeValue<EntityReference>("ownerid"));
context.Create(entity);

if any code issues or changes  please let me know 

.

Thanks

Saravanan S

  • LeoAlt Profile Picture
    16,341 Moderator on at

    Hi partner,

    Please check if your computer has installed .NET Framework 4.7 or higher version.

    You could also try to use OrganizationService to create the note.

    Guid attachmentId = Guid.Empty;
     
    Annotation note = new Annotation()
    {
        Subject = subject,
        NoteText = body,
        FileName = filename,
        DocumentBody = Convert.ToBase64String(data),
        ObjectId = new EntityReference(entityName, entityId),
    };
     
    attachmentId = service.Create(note);
     
    return attachmentId;

    https://carldesouza.com/dynamics-365-attach-note-record-c/

    https://csharpsql.wordpress.com/2015/11/20/c-code-to-create-a-crm-note-annotation/

    Best Regards,

    Leo

  • sars Profile Picture
    95 on at

    Hi ,

    Thanks for your response.

    Already i have installed in 4.7 and 4.7.1 framework in my machine.

    I will try your code then will update you.

    Thanks

    Saran

  • sars Profile Picture
    95 on at

    Am facing Same issue.

    System.Runtime.Serialization.SerializationException

     HResult=0x8013150C

     Message=Error in line 1 position 408. Element 'schemas.datacontract.org/.../System.Collections.Generic:value'

    contains data from a type that maps to the name 'System:ValueTuple`2'. The deserializer has no knowledge of any type that maps to this name.

    Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'ValueTuple`2' and namespace 'System'.

     Source=PluginProfiler.Library

     StackTrace:

      at PluginProfiler.Library.ProfilerContextOrganizationService.Create(Tuple`2 serializedValue, Assembly proxyTypesAssembly)

      at PluginProfiler.Library.ProfilerContextAppDomainOrganizationService.Create(Entity entity)

      at Plugins.Email.moveAttachmentsToCaseNew(CrmExecutionContext context, Entity& email, IServiceProvider serviceProvider) in Email.cs:line 405

      at .Plugins.Email.Execute(IServiceProvider serviceProvider) in \Plugins\Email.cs:line 53

      at PluginProfiler.Library.PluginAppDomainProxy.ExecuteCore(Stopwatch watch, ProfilerExecutionReport report, Object instance, Object executionParameter)

      at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)

    Regards

    Saran

  • Suggested answer
    Bipin D365 Profile Picture
    28,995 Moderator on at

    Hi,

    Can you please uninstall profiler if it is installed.

    Also, please paste entire plugin code here to investigate this issue further.

    If found helpful, Please mark my answer verified.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 60 Most Valuable Professional

#2
11manish Profile Picture

11manish 23 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans