web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to create a field ...
Finance forum

How to create a field which can lookup FINANCIAL DIMENSIONS

(0) ShareShare
ReportReport
Posted on by 972

Hi 

          On released product details, the Financial dimensions can drop down to select value.

          Now, I want to create a field in a table, and layout this field to a new form.

          How can I make this field to lookup "BankAccount" values, and select it.

Best Regards,

JustZM

8468.png

6811.png

I have the same question (0)
  • Verified answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi,

    If I understand your requirement correctly, you would like to create a field for a single financial dimension "BankAccount". I am assuming on a standard table. You can do following:

    1. Create an extension of the required table

    2. Create new string field with "DimensionValue" as ExtendedDataType

    3. On the form, add field and for the same form control create OnLookup event handler code as shown below:

                   FormStringControl   ctrl = _formControl as FormStringControl;

                   Args                args;

                   FormRun             formRun;

                   DimensionAttribute  dimensionAttribute;

                   select dimensionAttribute

                       where dimensionAttribute.Name == 'NameOfYourFinancialDimension';

                   args = new Args();

                   args.record(dimensionAttribute);

                   args.caller(_formControl);

                   args.name(formstr(DimensionLookup));

                   formRun = classfactory.formRunClass(args);

                   formRun.init();

                   ctrl.performFormLookup(formRun);

  • JustZM Profile Picture
    972 on at

    Hi Sumit Loya

             Thank you very much!

             It works.

    Best Regards,

    JustZM

  • Suggested answer
    Jean_Frederic Profile Picture
    10 on at
    In the meantime, there's a more streamlined solution:
     
    Create a string field and add to the form, then use the following code:

    [FormControlEventHandler(formControlStr(VendEditInvoiceeditCostCenter), FormControlEventType::Lookup)]
    public static void editCostCenterFilter_OnLookup(FormControl senderFormControlEventArgs e)
    {
        FormStringControl       control = sender as FormStringControl;
        DimensionValueLookupHelper::lookupDimensionValues(DimensionAttribute::findByName('CostCenter'), control,curExt());
    }

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans