cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
asdeev
Level: Powered On

Get all selected items from comobox when editing

Hi,

 

Whats the best way to get all the selected items from the combobox into edit form mode when editing?

 

Thanks!!

1 REPLY 1
AndySid
Level 8

Re: Get all selected items from comobox when editing

Hi,

I do not use forms but lay the controls on the canvas and use the ForAll and Patch functions. Much more flexibility.

 

hope this is useful? 

 

To cycle through the comboBox use the selectedItems example: cboDropContractNo_2.Selected.Contract

 

Exmaple Code for a timesheet entry I did...

 

ForAll(
    cboEmployee.SelectedItems.Employee,
    Patch(
        appDailyJobSheets_1,
        Defaults(appDailyJobSheets_1),
        {
            ContractNo: cboDropContractNo_2.Selected.Contract,
            CategoryID: cboCategory_2.Selected.Result,
            Added: Today(),
            Lunch: chkLunch.Value,
            Hours_x0020_Work: HoursWorked.Text,
            Entered_x0020_By: User().FullName,
            tID: Value(tID_input.Text),
            Item_x0020_Description: cboItemDescription_2.Selected.Result,
            DateText: Text(
                DateValue11_2.SelectedDate,
                "[$-en-US]dd/mm/yy"
            ),
            Start: HourValue11_2.Selected.Value & ":" & MinuteValue11_2.Selected.Value,
            End: HourValue12_2.Selected.Value & ":" & MinuteValue12_2.Selected.Value,
            Start_x0020_Time: DateValue11_2.SelectedDate + Time(
                Value(HourValue11_2.Selected.Value),
                Value(MinuteValue11_2.Selected.Value),
                0
            ),
            Employee: Employee
        }
    )