Allow a container/display method to have a lookup on a form?

I would like to store a list of companies in a container in a table. I want to display the companies on a form in a grid as “aaa, bbb, ccc”, so I use a display method with con2str(myTable.myContainer).

I want the user to be able to hit the lookup/drop-down and check which companies they want to be saved in that container.

What’s the best way to accomplish this? I’m struggling because for some reason I can’t get the lookup to work on a display method.

Hi Alex

Just try with this code.It displays the list of companies.If you select the company then if statement executes.

static void PickDataArea(Args _args)
{
DataAreaId dataAreaId;
;
dataAreaId = pickDataArea();
if (dataAreaId)
{
info(strfmt(“You’ve selected %1”, dataAreaId));
}
}

You are trying mix here two different things - displaying the container elements through a display method and giving user an option to select. You will not be getting a lookup for a display method - if you get the definition of the display method will go wrong[:)]

So you are done with the first thing - showing the container values.

the second one - the user selection - can you provide some details here???

I didn’t realize I wasn’t able to do a lookup on a display method. Struggled a bit here.

Say there are 5 companies, “aaa, bbb, ccc, ddd, eee”, I want the lookup to allow the user to select a subset of them, such as “aaa, ccc, ddd”. I was imagining a lookup with checkboxes, but it can be any way. A popup selection list might not be bad, such as when you setup a new data definition group and select your tables you want to use.

The part I’m struggling with is storing the data as a container, displaying it as a string, and allowing a lookup at the same time. Each piece alone seems easy, but together is difficult.