Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

how to show custom as well as standard financial dimensions in form lookup field.

(0) ShareShare
ReportReport
Posted on by 167

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!!

  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    RE: how to show custom as well as standard financial dimensions in form lookup field.

    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?

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how to show custom as well as standard financial dimensions in form lookup field.

    The relation is PSAParameter.CustomDimesion= DimensionAttribute.Name

    Here CustomDimesion is string field Whose EDT is name.

  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    RE: how to show custom as well as standard financial dimensions in form lookup field.

    Can you show us the relation, please?

Under review

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.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans