Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

How to change dateTime to current date when retrieved in Plugin

$
0
0

Hi All,

    I dont know if someone can help me in this, because dynamic CRM uses a UTC time and it is always a day before current time, I created a plugin, but when it retreved and assign the retrieved to a new entity field, the creation date is always in a day before, rather than the current local time, it was rerieved and created. , Ravi Kashyap’s Dynamics 365 Blog,  Example:

new_clinic target = (new_clinic)context.InputParameters["Target"];
DateTime newClinicDate = (DateTime)target.new_ClinicDate;
foreach (Entity conRole in ec.Entities)
                    {
                        conRole.Attributes["new_date"] = newClinicDate;
                        conRole.Attributes["new_clinicdate"] = newClinicDate;
                        service.Update(conRole);

In the above example, the updated has a an old date, rather than the date in the parent entity. Hw do i make the be current ??



Viewing all articles
Browse latest Browse all 79901


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>