Data Entity Archives -

Tag Archives: Data Entity

Duplicate address record entry through Data entity in Dynamics 365 Finance and Operations

Introduction:In this blog, we will see how to allow system for accepting duplicate addresses of customer, vendor or any other, through doing bit change in Data Entity  Solution:For allowing duplicate entries we will create one field in LogisticsPostalAddress. Here field name is as IsCreateFromEntity. Field-IsCreateFromEntity will be used as flag, type of boolean / NoYesId (EDT). [ExtensionOf(tableStr(LogisticsPostalAddressBaseEntity))] final class LogisticsPostalAddressBaseEntityCFSJSTable_Extension { public static LogisticsLocationId resolveRemittanceAddressLocationId(LogisticsPostalAddressBaseEntity _postalAddressEntity, DirPartyNumber _partyNumber) { LogisticsLocationId locationId, locationIdCreateNew; locationId = next resolveRemittanceAddressLocationId(_postalAddressEntity, _partyNumber); if(_postalAddressEntity.IsCreateFromEntity) { locationId = locationIdCreateNew; } return locationId; } } Aforementioned code would replace the standard locationId variable with new locationIdCreateNew which will be null always. Once new variable locationIdCreateNew is replaced with standard code,  system will generate the new locationId in the LogisticsLocation(Table) and create the same duplicate address along with state, city, country, zipcode and all other respective fields. Moreover, we will just need to pass YES value to the newly created field ISCreateFromEntity while creating the new address and run the execution. How easy it is!!! Thanks for reading !!!

Reading more then 10K records in D3FOE OData API

Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time using Data Entity. While reading records from D3FOE for CRUD operations in OData API you will face issue if you want to process more than 10K records at a time. You can resolve this issue by using query parameter ‘skip’ and ‘top’. Use the below syntax to query records while reading from D3FOE: DataServiceQuery<[EntityName]> EntityObject = context.[EntityName].AddQueryOption(“$skip”, 10000).AddQueryOption(“$top”, 10000); where, EntityName = Name of data entity from where you want to read records Skip = it will skip the number of records you specified from the fetched records Top = It will select the number of records specified after skipping the records Example: If there are 30K records in CustCustomers then above line will skip 10K records and then pick the next top 10K records. So records selected will be from 10001 to 20000. DataServiceQuery<CustCustomers> EntityObject= context.[CustCustomers].AddQueryOption(“$skip”, 10000).AddQueryOption(“$top”, 10000); You can also get the total count of records and then run a loop until max count of records and increment the skip with 10K on each loop and top with 10K. Using this you can read ‘n’ number of records.

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

[gravityform id="36" ajax="true"]

FOLLOW CLOUDFRONTS BLOG :