connect 2022 banner tablet connect 2022 banner mobile


By Bill Thompson | April 11, 2019

Recently I had a request to create a custom form in 亿博电竞 365 Finance and Operations. One requirement was that prior to the form opening, it would prompt the user for a date (defaulted in with the current date) and a value from a specific financial dimension.  The working prompt form would look like this (with the custom lookup code on the financial dimension):

Custom dialog on form opening

So, here’s how I would create a custom dialog on a form with a customer lookup for a specific financial dimension in D365 FinOps. The dialog code itself is not hard to do.  It simply is placed in the init() method of the main form:

																																																															/// Build the dialog that prompts the user for a date and a site to process ///
																																																														public void init() { super(); // build the dialog for prompt Dialog dialog = new Dialog("Label goes here",element); DialogField dfDate = dialog.addField('Date1980','Date'); dfDate.value(DateTimeUtil::getToday(DateTimeUtil::getUserPreferredTimeZone())); DialogField dfDimValue = dialog.addField('DimensionValue','LocationSite'); FormBuildStringControl control; control = dfDimValue.control(); // use the custom lookup control.registerOverrideMethod('LookUp','dimLookup',this); // if we click OK, we run, otherwise, close the form if ( { dlDate = dfDate.value(); dlDimValue = dfDimValue.value(); boolean dlClosed = dialog.closedOk(); if (dlClosed) { // code does in here } } else { element.close(); } }

This key line in the code above is the following:


This line allows us to override the lookup method of the control in the dialog, and replace it with our custom code.  This method exists on the form as well.

																																																															/// This is the custom lookup code for the LocationSite financial dimension field on the user prompt dialog ///
																																																													private void dimLookup(FormStringControl _control) { Query query = new Query(); QueryBuildDataSource qbdsDimensionFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag)); QueryBuildRange qbrFinancialTagCategory = qbdsDimensionFinancialTag.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)); qbrFinancialTagCategory.value(strFmt('%1', DimensionAttribute::findByName(dimName, false).financialTagCategory())); SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(DimensionFinancialTag), _control,true); sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value), true); sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description)); sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, FinancialTagCategory)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); }

This is pretty standard lookup code using the SysTableLookup class.  That is all that is needed to accomplish my requirements (other than some specific requirement code that is not relevant here).

You can use this method to create any custom dialog form opening and have a customer lookup for any specific financial dimension in D365 Finance and Operations. If you have any more questions on how to do this yourself, please contact us.

Related Posts

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

csgo完美世界 加拿大28pc预测神测网 飞鱼电竞下注积分 加拿大28冷号APP计划 lol联赛 大圣电竞开盘