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

Datetime issue

$
0
0

Hi,

Can anyone help me regarding my problem in DateTime?

Here's my scenario:

I have 3 record, a Level 1, Level 2 and Level 3.

When I update the Level 3, the Est. Start Date and Est End Date of Level 1 and 2 must capture the field data in Level 3. But when the plugin runs, the date before the selected date in Level 3 reflects in Level 1 and 2. see image below

So if I select 12/28 in Level 3, 12/27 will reflect in Level 1 and 2.

Here's my code for Start Date

if (c.Attributes.Contains("new_eststartdate"))
                            {
                                
                                if (dateEstStart == new DateTime(1753, 01, 01, 00, 00, 00))                               
                                    dateEstStart = ((DateTime)c.Attributes["new_eststartdate"]).ToLocalTime();                                                                                                        

                                currEstStart = ((DateTime)c.Attributes["new_eststartdate"]).ToLocalTime();                                    

                                dtStartResult = DateTime.Compare(currEstStart, dateEstStart);
                                if (dtStartResult < 0)
                                    dateEstStart = currEstStart;
                            }
DateTime newStartDate = new DateTime(1753, 01, 01, 00, 00, 00); newStartDate = dateEstStart; if (dateEstStart != new DateTime(1753, 01, 01, 00, 00, 00)) ParentEntity.Attributes["new_eststartdate"] = newStartDate;


Can anyone help me about this?

Thank you very much!


Viewing all articles
Browse latest Browse all 55831

Trending Articles



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