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

Set modified on with plugin

(0) ShareShare
ReportReport
Posted on by 2,911

Hi all

I am setting modifiedon when importing historic records with kingswaysoft.

I need to set phonecall etc so it shows on timeline correctly.

I have created a plugin on Create phonecall pre operation -> synchronus.

 public void Execute(IServiceProvider serviceProvider)
        {
            IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            Entity entity = (Entity)context.InputParameters["Target"];
            if(entity.LogicalName == "phonecall")
            {
                DateTime modDate = (DateTime)entity["doc_overriddenmodifiedon"];
                entity["modifiedon"] = modDate;
             }
            
        }

modifiedon is not changing it stays as when the record is created saved, Debug plugun shows it stepping through plugin and changing date.

  • antc Profile Picture
    2,911 on at

    Still stuck with this issue however have noted that if I don't set status and leave phonecall open it works.

    Update other fields it works.

    Update status and or state it doesn't work. The plugin still fires however when status changes something else must be happening in the system to modify the field again.

    Any ideas?

  • Suggested answer
    Samuel Cavichioli Profile Picture
    Microsoft Employee on at

    Hi,

    The modifiedon field is read-only.

    pastedimage1593531438313v1.png

    Please, refer to the phonecall entity definition: phonecall EntityType.

  • antc Profile Picture
    2,911 on at

    True however it can be changed via code if I don't close the activity it shows the date I set it via my create plugin on import.

    My issue is when I set the status to complete my update plugin changes it pre operation however there must be a system process that is touching it after that which is setting it back.

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

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 42

#2
11manish Profile Picture

11manish 19 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 19

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans