Could really use some help with how to update an additional field based on a epicombobox selection. In this case, I’m selecting the late reason code, but also want to update an ‘exempt’ field based on that selection. I’m updating a UD table record here with values stored in a different UD table.
Welcome!
As long as your exempt field is bound to the right table and field, then you shoudl be able to use an event to trigger populating the field based on your combobox selection. If you are customizing, you can use the wizard to make an event based on the value in the combo box changing. Here is an example where I have two combo boxes, one shows the resource group, and the other shows the resource group ID code. The code I use waits for you to choose a value in one box, then updates the other box to match.
private void MyResourceID_ValueChanged(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
MyRGID.Value = MyResourceID.Value;
}
First, many thanks for the help! I’m starting to head in a useful direction.
I have created a ValueChanged block with the wizard and am setting the checkbox value manually in the code. Still have 2 challenges - First, not sure how to reference the true/false value associated with the selected value in the combobox. Also, I was setting the extended property for the checkbox to ready only = true, but this appears to prevent me from setting the value in the ValueChanged block. So, not sure how to turn read only off and on to set the value when needed.
I think I see the issue. Your combo box with all the reason codes, and the check boxes stores only a single value. The combo box has a display member, and a value member. The display member is what gets show in the drop down box, and the value member is the value that gets stored in the table. I am not sure about how you can access the other columns in the combo box. My thought is to set your combo box’s value member to the checkbox field. Then you should be able to set your exempt checkbox with something like this:
Thanks again for the suggestions. Ultimately, I had to go a different direction in order to avoid losing my combobox value, which I needed to maintain to update the table. Instead, I did a lookup with a BAQ to find the value for exempt. A little slower than I wanted, but acceptable performance. I did have a weird symptom of losing the selected value to the combobox when I updated the checkbox, but used a work-around.
My only remaining issue is still not being able to set the exempt checkbox to read-only. I need a solution for that. Can’t seem to set extended properties to read only and still be able to set the value of the checkbox in code. Not sure if I can set/unset/reset extended properties.