UpdateSegLine(VAR SegLine : Record "Segment Line";Emails : Code[10];Subject : Text;DateSent : DotNet "System.DateTime";DateReceived : DotNet "System.DateTime";AttachmentNo : Integer) InformationFlow := SegLine."Information Flow"; SegLine.VALIDATE("Interaction Template Code",Emails); SegLine."Information Flow" := InformationFlow; SegLine."Correspondence Type" := SegLine."Correspondence Type"::"E-Mail"; SegLine.Description := COPYSTR(Subject,1,MAXSTRLEN(SegLine.Description)); IF SegLine."Information Flow" = SegLine."Information Flow"::Outbound THEN BEGIN LineDate := DateSent; SegLine."Initiated By" := SegLine."Initiated By"::Us; END ELSE BEGIN LineDate := DateReceived; SegLine."Initiated By" := SegLine."Initiated By"::Them; END; // The date received from Exchange is UTC and to record the UTC date and time // using the AL functions requires datetime to be of the local date time kind. LineDate := LineDate.DateTime(LineDate.Ticks,DateTimeKind.Local); SegLine.Date := DT2DATE(LineDate); SegLine."Time of Interaction" := DT2TIME(LineDate); SegLine.Subject := COPYSTR(Subject,1,MAXSTRLEN(SegLine.Subject)); SegLine."Attachment No." := AttachmentNo; SegLine.MODIFY;
Comments
Else i'd suggest to just quickly fire up VisualStudio and try it on your own, but to be honest, changing it from local to utc is an ok change if it works for you imo.
/wisa