I have created a custom data entity with name xyz_currentforecastdataentityV2. I am publishing a record through excel using my entity in which there is field with the name ''Name''. I have requirement when I give the value in Name field it should get the RecId value from ResourceView and assign that value to my custom table xyz_CurrentForeCastTable (same table is being used in my custom entity xyz_currentforecastdataentityV2) in field ProjResource. As shown in below code
public boolean insertEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx) { boolean ret; RESOURCEVIEW resourceView; xyz_CURRENTFORECASTTABLE currentForecastTable; select RecId from resourceView where resourceView.Name == this.Name; currentForecastTable.ProjWorkerResource = resourceView.RecId; ret = super(_entityCtx, _dataSourceCtx); return ret; }
I have tried using this code but I am retrieving wrong RecId. I tried the same query in SQL and runnable class there I am getting the right value of RecId.
I suggested no solution - I asked you some questions and explained why they're relevant. Could you answer them, please?
I already try this solution but still not fixed my RecId issue.
Is Name guaranteed to be unique inside ResourceView? If not, the database can give you any of the records with this name.
Also, did you take DataAreaId into account in your SQL code and did you use the same company when running your runnable class as the one used for the import? If not, you're comparing different things and you're expected to get different results.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156