Goal: My contact wants to be able to create a dropdown menu where you can have multiple options selectable and storable for this custom field. We would like this to be applied to the Item Card header.
End goal concept
Alternatively, they would like to create about ten dropdown fields in Business Central while keeping the use of purchases to a minimum if the above goal is currently unattainable.
We have in mind that the ten dropdown fields will contain varying multiple different options and each option will be unique and will differ from each other dropdown field.
Please also be aware that I am of a low code/non-developer background.
Any help is much appreciated.
Since I was unable to create the multiple select drop down menus, I have opted for the ten individual Option Lists (Enum) described in this source: https://yzhums.com/5985/ as I spent way too much time attempting to get a Lookup list (Multi Select) solution to work where I recall the equivalent of the Text += PurchaseCodeList.GetSelectionFilter(); was pulling up an error against the specific "Purchase Code List" page saying that GetSelectionFilter was not recognised as an existing function. I looked up how to rebuild GetSelectionFilter to work for the Purchase Code List page indicated here https://yzhums.com/27561/ but I was unsuccessful and ended up confused following this guide.
Thanks for this response.
I made the attempt of writing up something that uses the "Purchasing Codes" as the lookup page to base my selections off as the variable PurchaseCodeList.
layout { addlast(InventoryGrp) { field(MyField; Rec.MyField) { ApplicationArea = all; trigger OnLookup(var Text: Text): Boolean var PurchaseCodeList: Page "Purchasing Codes"; begin PurchaseCodeList.LookupMode(true); if not (PurchaseCodeList.RunModal() = Action::LookupOK) then begin Clear(Rec.MyField); exit(false); Text := PurchaseCodeList.GetSelectionFilter; end else begin exit(true); end; end; } } }
I am currently having the problem where I am trying to add this portion of the code in my .al file but it is giving me an error message in the Problems console output tab: 'Page "Purchasing Codes"' does not contain a definition for 'GetSelectionFilter'
Text := PurchaseCodeList.GetSelectionFilter;
I have seen seen the source https://yzhums.com/27561/ to see how to get the GetSelectionFilter to work but I am unsure how to obtain the GLAccountList.Page.al or how to produce one myself.
I have attempted to create a file containing codeunit 46 selectionFilterManagement with my current VSCode settings but I am still getting the same 'Page "Purchasing Codes"' does not contain a definition for 'GetSelectionFilter' error after confusing myself that I thought that I have provided this definition with this file.
At the moment, I have gotten the Purchasing Codes page to show on the drop down menu but selecting a single or multiple values does not return the selection in the text box of my field.
Completely appreciated the help so far.
Hi, Just to add an example for Daniele's idea.
How to get a filter for the selected records on any page (For example, ‘1..3|6’)
Hope this helps.
Thanks.
ZHU
Hi,
Adding info-:
https://erpconsultors.com/creation-of-table-in-dynamics-365-bc/
Regards
Amit Sharma
Hi
I would add that in order to retrieve the field values with the example string Value1|Value3..Value4|Value2
you will just need to create a function that filters the table with all possible values and insert them where needed for example in a print report or page
DAniele
Hi
My idea would be as follows:
create a table where all possible values of the new field will be entered.
Hook the new field with a Lookup AL to the page of the table of possible values, so as to make a multiple selection, and insert in the new custom field the selected values as in the example:
Value1|Value2..Value3|Value4
in order to retrieve the values from the custom field you would have to make a function that parse the string.
You can take the Totaling field of the G/L Account as a reference and see on the G\L Account Card page the code under the Lookup of the Totaling field:
"GLAccountList.LOOKUPMODE(TRUE);
IF NOT (GLAccountList.RUNMODAL = ACTION::LookupOK) THEN.
EXIT(FALSE);
Text := OldText + GLAccountList.GetSelectionFilter;"
Greetings
DAniele
create a field similar to the TOtaling of the G/L Account
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156