Hi Claudia,
the source code of what i try to do:
// Try 1
CollectableSearchCondition subCond = SearchConditionUtils.newComparison(
"Address",
"streetno",
ComparisonOperator.EQUAL,
"42" );
CollectableSubCondition query = new CollectableSubCondition(
"Address",
"personaddress",
subCond);
// run the query
MasterDataDelegate mdd = MasterDataDelegate.getInstance();
Collection res = mdd.getMasterData( "Person", query);
The above gives me the error „entity field personaddress in Address does not exists.“
Obviously the problem is in how i construct the CollectableSubCondition query.
I saw the comment of the class and thought that when it says sSubEntityName
this for me is the Address entity and when it says sForeignKeyFieldName
this for me is the field of Person that points to my
sub entity, thus personaddress.
Then i tried changing the query as:
// Try 2
CollectableSubCondition query = new CollectableSubCondition(
"Person",
"personaddress",
subCond);
Changing Address to Person, since Person has
a field personaddress, gives the error:
„entity field streetno in Person does not exists“.
Not sure why it looks in Person to find the streetno
since my subCond connects Address with streetno, as it makes sense.
Finally, after seeing your comments, i changed the subCond
using the newMDComparison rather than simply newComparison.
// Try 3
CollectableSearchCondition subCond = SearchConditionUtils.newMDComparison(
MasterDataDelegate.getInstance().getMetaData("Address"),
"streetno",
ComparisonOperator.EQUAL,
"42" );
This gives the same error as Try 2.
So any comments and help is more than welcomed!
Thank you,
Vagelis Savvas