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 :
Customer Service forum

How to append new value with the old value of a filed using plugin(C#)?

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

I have a requirement to update a field with old and new values using plugin.

For example i have a field on my case form named "Title",

so the title already contains the old value = "Sham",

and i want to append the new value ="Ram" with the old value "Sham".

Finally the revised title should be "Sham Ram".

Can i achieve this functionality using Plugin.

Thanks for your time ,

Please help me to achieve this functinality.

Categories:
I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can do that. You should do pre-operation plugin that will get "new" value from "Target" of InputParameters and "old" value from Pre-Image, concatenate and put it back to "Target". My recommendation - start doing it and if you experience issues just post your progress here. Here is where you can start - docs.microsoft.com/.../sample-create-basic-plugin

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    If you don't want to use Plugins, then you can also achieve this by creating 2 real time workflow which triggers on before & after field update. The before workflows, sets the old value in some temp field and after workflow sets the name from the temp field and the new name field.

    Something similar to this but instead using 2 workflows-www.powerobjects.com/.../real-time-workflow-capturing-pre-and-post-values

    Post any issues here if you try this.

    Hope this helps.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    Yes, you can achieve it by plugin, workflow and java script.

    But you need to make sure that how this value get append: Actually plug-in and java script get trigger on event like  create, update etc.

    If you want to update this value manually then go for workflow. You can take help from below link:

    crmramblingsbysteven.wordpress.com/.../how-to-concatenate-two-fields-using-workflow-in-dynamics-crm-2011

  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Jakkani,

    It is possible to use plug-in to append new and old value to a field. 

    You could refer to the following code.

    //Set the update entity
    Entity case= new Entity("case");
    case.Id = Id;//you should get the record id first
    case.Attributes["Title"] ="Ram"+case.Attributes["Title"];//splicing string
    
    //Update
    service.Update(parententity);

    In addition, I recommend another OOB method through workflow.

    community8.PNG

    You could set up a workflow when you update the record and set the action to "append with".

    Hope it helps.

    Best Regards

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans