Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 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
So I have been playing around with valid time state tables and the date effective features in AX 2012. On form datasources one can set the property "ValidTimeStateUpdate". The possible values and their meaning are described as:
* CreateNewTimePeriod – A new record is inserted into the table to maintain the validity of the date effective data after the update_recordset statement completes. * Correction – The ValidFrom or ValidTo values of existing rows must be modified to keep the date effective data valid after the update_recordset statement completes. * EffectiveBased – Records in the past cannot be edited. Records that are currently active are edited in a manner similar to CreateNewTimePeriod mode. Future records are edited in a manner similar to Correction mode.
I tried to figure out scenarios to show the differences between the 3 values, but was unsuccessful. I'm especially interested in "CreateNewTimePeriod", which is supposed to create new records. Has anyone seen a scenario where that is the case?
I read throughhttp://msdn.microsoft.com/en-us/library/gg841023.aspxandhttp://msdn.microsoft.com/en-us/library/gg843767.aspxand the Web Seminar provided herehttps://training.partner.microsoft.com/learning/app/management/LMS_ActDetails.aspx?UserMode=0&ActivityId=742581but could not find an answer.
The question is quite old but if any is interested... the records are really inserting but the form is showing only active data. If you run a Jof exploring all the dates (or explore throug SQL Server table) you'll see the new versions created for each change.
"CreateNewTimePeriod" is actually used often. The best way to understand the differences is to apply a scenario to it. I'll use some made up examples/numbers.
You have a customer A with one active address record:
LogisticsPostalAddress.Address = "123 South St, Chicago, IL"
LogisticsPostalAddress.ValidFrom = DateTimeUtil::minValue();
LogisticsPostalAddress.ValidTo = DateTimeUtil::maxValue();
Let's say you have a SalesOrder SO123 that you shipped to Customer A at address "123 South St, Chicago, IL" (RecId 52565480000) on 1/1/2016.
Later, the customer calls you and asks you to update their address to "321 North St, Chicago, IL". Well for audit/history purposes, whenever you look at SO123's packing slip, you want to know it was shipped to 123 South St. So CustPackingSlipJour.DeliveryPostalAddress = 52565480000.
When you update the 52565480000 record, the state is by default "CreateNewTimePeriod", and when you save the record it does an Update then Insert, where the update expires 52565480000 (ValidTo = DaetTimeUtil::utcNow()), and the insert creates a new record with [ValidFrom = DateTimeUtil::utcNow(); ValidTo = DateTimeUtil::maxValue();]
"Correction", would be if you wanted to change an address and have it be persisted everywhere that the address was used, or sometimes when you're working with an address record, it's saved at various points and you don't want to keep creating new records when the user isn't finished working with it.
"EffectiveBased" means that if you wanted to modify both expired records (where .ValidTo < utcNow()) and effective/active records (where .validFrom()<=utcNow() && .validTo()>=utcNow()) in some sort of process, then it'll do "Correction" actions when the record is still an effective date, but will do CreateNewTimePeriod and create a new address record when it's no-longer active to persist historical addresses.
The first time I'm confuse in this situation too, but I've understood with your explanation
But I would like to ask you the question that relative to code (X++), Is there any way to get the record that have just updated (and cause one more record insert) use RecID ?
I select to get RecID of update record, and use code
WHERE logisticsPostalAddress.RecId == [RecID]
but that can't get info of record.
X++ wise there is no "new" record, this is part of the implementation but with a regular select you will only the record that satisfies the filter, including the Valid* dates regarding this framework (or the implied filter if you don't specify them).
You can see the SQL final statement to understand it better.
Business Applications communities