Hi,
I have duplicated the GeneralJournalAccountEntryEntity . I had a requirement to add the unmapped non-computational field. It takes a lot of time to export the data. Any better way to get the data in quick manner?
Yes, mapDatasourceToEntity is called during data export. Please check my comments again.
mapDataSourceToEntity: Data Entity Export
mapEntityToDataSource: Data Entity Import.
Oh I was under impression that mapDatasourceToEntity is used for export as the data source fields are mapped to Entity.
I'm also referring to mapDataSourceToEntity method not mapEntityToDatasource. This data entity is ReadOnly so mapEntityToDatasource will not be called.
Hi Preetham,
I am saying mapDatasourceToEntity method not mapEntityToDatasource. Any idea in which entity I can check for the same. Also the document which you shared is very good but I need to use the following code to fetch the customer name.
AccountName accountName; if (this.MainAccount)// i amgetting this value at entity level { // Try to find a translation for the current user language. accountName = MainAccountTranslation::getLocalizedName(this.MainAccount); } // Name is a mandatory field -- if it not found after the invariant, it is likely because the Name column was not selected by the query. // If from a form control linked DataMethod, set CacheDataMethod to No and if the MainAccount is joined as a referenced data source and change OnlyFetchActive to No return accountName;
You can check mapDataSourceToEntity method from below article and get table buffer by finding GeneralJournalAccountEntryRecId in table's RecId. However, I don't think it will improve performance but you can try. Creating Computed method is tricky due to various conditions and method calls in display method. Another solution is to create custom table to store that accountName and use that table as dataSource in the entity. So, it will be mapped field instead of Virtual field. You have to write code in insert & update of MainAccount and MainAccountTranslation table, so if value is inserted or changed it should be updated in your custom table as well.
For computed column you can try this link.
www.atomicax.com/.../part-16-action-methods-and-computed-columns
As I said earlier you can only write postload for export and not mapentitytodatasource as the 2nd method is for import.
Hi Preetham,
I had written the display method logic in postLoad and it gave me the performance Issue. That's why I am asking how I can write in Computed column or mapDataSourceToEntity.
For performance the way I said is good. Can you try that display method as I said?
If not possible then you have to do that in postload method.
Hey Preetham,
At form level they have written a display method with if and else condition, thats why I am trying to write a code. Also I need the financial dimensions seperately. For that also I would be needing the code to write.
I don't mean you to write the code. If you go with code, it will anyway impact performance. As you require the name of the account number, let's assume you have to do same in form level. So, what you do? You will add that datasource in form, give the relation and set the join property. Finally, you will get the name of the account. Similarly, you can do the same in the entity as well. That won't impact anything.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156