Hi All,
As far as I am concerned, 'isFieldSet' method of a data entity is to check to see if the field is returned by the connector.
* If the field specified by field_name is returned by the Connector, returns a Boolean True.
* If the field specified by field_name is not returned by the Connector, returns a Boolean False.
In some of methods in data entities, it is trying to clear out 'isFieldSet' method like below example.
What is the detailed reason for this?
public void initializeEntityDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
super(_entityCtx, _dataSourceCtx);
switch (_dataSourceCtx.name())
{
case dataEntityDataSourceStr(PurchPurchaseOrderHeaderV2Entity, PurchTable):
// clear out 'isFieldSet' so the defaulting logic does not consider fields that were set by initValue as specified by the user
_dataSourceCtx.setAllFieldStatesToNotSet();
break;
}
}
///
/// Sets field state for all fields to the "Not set" value.
///
/// The data source context.
public static void setAllFieldStatesToNotSet(DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
_dataSourceCtx.setFieldStateForAllFields(FieldState::NotSet);
}
Thank you.