d.bernaert Posted July 28, 2020 Share Posted July 28, 2020 Hello, I'm still having a problem with unidblookupcombobox when using the mode umNameValue. I have a unidblookupcombobox filled with customers with the mode umNameValue to be sure that the correct customer is selected. I also have a trigger on the unidblookupcombobox that allow the user to create a new customer if not present in the list. When the user clicks the button to create a new customer, he gets a popup where he can create the customer. When returning, in the callback I refresh the list linked to the unidblookupcombobox to have the new customer included in the list. When selecting the new customer, I always get index out of bounds. I don't have it when using mode umNameOnly. Anybody? Link to comment Share on other sites More sharing options...
Sherzod Posted July 28, 2020 Share Posted July 28, 2020 16 minutes ago, d.bernaert said: I'm still having a problem with unidblookupcombobox when using the mode umNameValue... Hello Dominique, How can we reproduce this issue? Link to comment Share on other sites More sharing options...
d.bernaert Posted July 28, 2020 Author Share Posted July 28, 2020 I will try to create a small testcase. Link to comment Share on other sites More sharing options...
d.bernaert Posted July 28, 2020 Author Share Posted July 28, 2020 Hi Sherzod, Here included you can find a testcase. Just run the application, you will see the dropdown contains 2 customers. Click the button to create a new customer in the customers table. Click on the combobox and select the new customer in the list, you get index out of bounds. Dominique unidblookupproblem.zip Link to comment Share on other sites More sharing options...
Darth Florus Posted July 29, 2020 Share Posted July 29, 2020 Normally to solve this kind of problem I point to nil the TDataSource.DataSet property attached to the TUniDBLookupComboBox, refresh the dataset and then point the TDataSource to the actual TDataSet descendant that have the data. Best Regards Link to comment Share on other sites More sharing options...
d.bernaert Posted July 30, 2020 Author Share Posted July 30, 2020 Hi, thank you for your answer, but it does not seems to solve the issue. I've tried with the following code (removed the datasource and the listsource just to be sure) in the callback but I still get index out of bounds. procedure TQuotesAddFrm.CallBackInsertUpdateAccount(Sender: TComponent; AResult: Integer); begin if CrmAccounts.Active then begin ComboAccount.DataSource := nil; ComboAccount.ListSource := nil; CrmAccounts.Refresh; ComboAccount.ListSource := DsCrmAccounts; ComboAccount.DataSource := DsHeaderWork; if UniMainModule.Result_dbAction <> 0 then UniFinancialModule.HeaderWork.FieldByName('Account').AsInteger := UniMainModule.Result_dbAction; end; end; Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 10, 2020 Administrators Share Posted August 10, 2020 I will try to address this in the next build. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now