314
Views
5
Comments
Solved
Save Selected Value of Dropdown Search to Entity
Question
Application Type
Reactive

Hi everyone,

I'm looking for some assistance with updating a normal dropdown to a search dropdown due to a long list of projects. I've attempted to implement this change, but I'm having trouble saving the selected value to the entity.

I've attached my OML for reference, and I would greatly appreciate any help or advice on this issue.

Thank you,
Andrew

dropdown+search.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Andrew Smith ,

you can specify that as the startingselection.


There is another issue with your implementation though, your EditQuote doesn't work well : when saving without changing selection, it looses selection.  The reason is that in the UpdateOnClick, you are copying the SelectedValue to the aggregate value in order to save that to the database.  But your SelectedValue only ever gets populated when the DropdownSearch at least gets fired once.

I solved that for you by directly updating the aggregate value on the DropdownSearch, no need for that extra SelectedValue local variable.

Dorine

Attached your oml fixed

dropdown+search+modified+again.oml
2023-02-06 14-27-11
André Smit

Thanks to your valuable input and feedback @Dorine Boudry, my day tomorrow will be off to a much smoother start. Your ongoing support is greatly appreciated.

2026-04-13 05-08-14
Pankaj Jain
Solution

Hi Andrew Smith,

You are doing correct way, Normally the Dropdown gives the value in text format then we need to convert the text into long integer and then long integer needs to be converted into Identifier.

LongIntegerToIdentifier(TextToLongInteger(SelectedItem.Current.Value))

Thanks
Pankaj

dropdown+search.oml
2023-02-06 14-27-11
André Smit

Thank you, @Pankaj Jain, for your assistance.

I have a follow-up question regarding the Dropdown Search. Specifically, how can I populate it when editing a quote to display the selected project from the entity?


I have attached an updated OML with the quote-editing option for reference. Your guidance on this matter would be greatly appreciated. Thank you.


dropdown+search+modified.oml
2023-02-06 14-27-11
André Smit

I believe I may have resolved the issue. However, I am unsure if my approach follows best practices, and I welcome any suggestions for improving it.



2026-04-13 05-08-14
Pankaj Jain
Solution

Hi Andrew Smith,

You are doing correct way, Normally the Dropdown gives the value in text format then we need to convert the text into long integer and then long integer needs to be converted into Identifier.

LongIntegerToIdentifier(TextToLongInteger(SelectedItem.Current.Value))

Thanks
Pankaj

dropdown+search.oml
2023-02-06 14-27-11
André Smit

Thank you, @Pankaj Jain, for your assistance.

I have a follow-up question regarding the Dropdown Search. Specifically, how can I populate it when editing a quote to display the selected project from the entity?


I have attached an updated OML with the quote-editing option for reference. Your guidance on this matter would be greatly appreciated. Thank you.


dropdown+search+modified.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Andrew Smith ,

you can specify that as the startingselection.


There is another issue with your implementation though, your EditQuote doesn't work well : when saving without changing selection, it looses selection.  The reason is that in the UpdateOnClick, you are copying the SelectedValue to the aggregate value in order to save that to the database.  But your SelectedValue only ever gets populated when the DropdownSearch at least gets fired once.

I solved that for you by directly updating the aggregate value on the DropdownSearch, no need for that extra SelectedValue local variable.

Dorine

Attached your oml fixed

dropdown+search+modified+again.oml
2023-02-06 14-27-11
André Smit

Thanks to your valuable input and feedback @Dorine Boudry, my day tomorrow will be off to a much smoother start. Your ongoing support is greatly appreciated.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.