Hi,
I have a custom form with datasource as PSAParameter(this datasource contains one string field and has a relation with DimensionAttributes.Name) and in one of the form control., I need to show the lookup containing custom dimension names as well as standard dimension names that comes from GL>Chart of accounts>financial dimension.
So I tried to write the following piece of code inside formlookupeventhandler but while selecting dimension other than custom one it is throwing error :The value 'A' in field 'Custom project dimension' is not found in the related table 'Dimension'.
QueryBuildDataSource qbds;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), sender);
Query query = new Query();qbds = query.addDataSource(tableNum(DimensionAttribute));
qbds.addRange(fieldNum(DimensionAttribute,BackingEntityTableId)).value(queryValue(tableNum(DimensionFinancialTag)));
//The value A is coming from DimensionAttribute.BackingEntityTablename=OMOperatingUnit
qbds.addRange(fieldNum(DimensionAttribute, BackingEntityTableId)).value(queryValue(tableNum(OMOperatingUnit)));
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, ReportColumnName));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
ce.CancelSuperCall();
Please suggest me where I am getting wrong.
Thanks!!
Let's forget the lookup for a moment.
Are you saying that you have DimensionAttribute record with Name = A but if you put A to CustomDimesion field, you get an error when saving PSAParameter record?
The relation is PSAParameter.CustomDimesion= DimensionAttribute.Name
Here CustomDimesion is string field Whose EDT is name.
Can you show us the relation, please?
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156