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.