Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I want to remove datetime values from a field of a table using code.
There is already some value in the datetime field. If I want to make that field empty.
Methods I have tried:
1. RandomTable."Approval Date Time" := 0DT;
2. CLEAR(RandomTable."Approval Date Time");
If I try code like below then it updates the field with current datetime but I am unable to clear its value using above two methods.
RandomTable."Approval Date Time" := CURRENTDATETIME;
Any help in this regard is highly appreciable.
After you run the first code what value are you seeing in that field? usually on SQL side there is a default value for those fields something like 1753....
After running first code I see the same old value that is populated before by using the CURRENTDATETIME function.
That is not possible unless there is another code which is overwriting it again. What version you are using?
It is BC 1416 OnPrem
Tested this on BC14 and I don't see any issue. I just used the below code under update action
"Created On" := 0DT;MODIFY;
Thanks Suresh for going beyond for helping me. I acknowledge it.
But I am using C/AL code in background to update these fields without getting user input. But I will check my code again.
The above example is also in CAL on BC 14
Yes, this way it has worked. I was trying to change multiple records that are coming to filter like this:
Now I have loop over all filtered records and used:
TableVariable.DateTime := 0DT;
But I am still confused why it was not working for all filtered using ModifyAll because all other fields are updating correctly using ModifyAll.
Anyways, it worked for now and thanks for your answer. I have verified that.
Business Applications communities