I'm trying to import data to an entity but i'm getting this error:
update not allowed for field 'TableX.Field1'
The entity is not read only. The entity contains TableX as a primary datasource (notread only) and it's outer joined with Table1 (which is a read only)
the entity key is another field: Field2 (not Field1)
Field1 in the entity is private
The entity staging table doesn't contain Field1
In the table itself (TableX), Field1 is mandatory, "allow edit" is false and "allow edit on create" is true.
Also the unique index for this table contains more than one field, and this Field1 is one of them.
I exported one record and tried to import again and got the same error.
There is this code in the entity:
public boolean insertEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
boolean ret;
if (_dataSourceCtx.name() == tableStr(TableX))
{
Table1 table1;
select firstonly Field1, FieldA, FieldB from table1 where Table1.FieldC == this.FieldZ;
TableX tableX = _dataSourceCtx.getBuffer();
tableX.Field1 = table1.Field1;
tableX.FieldA = table1.FieldA;
tableX.FieldB = table1.FieldB;
_dataSourceCtx.setBuffer(tableX);
}
ret = super(_entityCtx, _dataSourceCtx);
return ret;
}
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.