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

Can't able to set value in read only field using plugin

(0) ShareShare
ReportReport
Posted on by

hi Guys,

I have a custom entity called receptionmanagementsystem while save the record want to set value in read only field..but the value is not coming...here it is my code..

if(context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName == "new_receptionmanagementsystem")
{

Entity reception = new Entity("new_receptionmanagementsystem");
//string note = "New one is coming to meet you";
reception["new_welcomenote"] = "New one is coming to meet you";
service.Update(reception);

}

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Dinesh,

    Though you are updating a reception entity the plugin doesn't knmow what to update.

    in short you dont have initialize the entity again.

    if(context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)

    {

    Entity entity = (Entity)context.InputParameters["Target"];  // this is the entity on which your plugin is running so use it.

    if (entity.LogicalName == "new_receptionmanagementsystem")

    {

    // Entity reception = new Entity("new_receptionmanagementsystem"); // no need of this line you have the "entity" object already

    entity ["new_welcomenote"] = "New one is coming to meet you";  

    service.Update(entity);

    }

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

    Hi,

    How do you set the value of the field ? If you are setting using JS then try to set setSubmitMode= "always" for   attributes which are read-only in the onsave method using javascript.

    Xrm.Page.getAttribute("FieldName").setSubmitMode("always");

  • DineshRaja Profile Picture
    on at

    Thanks Man..after that while trigger the plugin error is coming.. The Error is : Record Is Unavailable

    The requested record was not found or you do not have sufficient permissions to view it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans