Tony Lanzer
Tony Lanzer

Reputation: 291

Acumatica checkbox won't update on field value change

I have a custom DAC field bound to a checkbox, but when I update the value of the field within code:

SOOrderExtension orderExt = PXCache<SOOrder>.GetExtension<SOOrderExtension>(row);
orderExt.UsrSignatureRequired = true;

the checkbox check is not updated on the UI. First I tried adding this line in the FieldUpdated event because this has worked for me before:

Base.Document.Update(row);

That didn’t work. Then I tried a suggestion I found on StackOverflow that forces a save and cache refresh, but my row (SOOrder) can’t save yet due to some validation rules, so that didn’t work. I think I need some kind of callback to the client to tell the UI to update itself, but usually this happens through events of bound fields. Suggestions?

Using v6.10.1219

Upvotes: 3

Views: 1526

Answers (1)

Tony Lanzer
Tony Lanzer

Reputation: 291

A colleague suggested I use cache.SetValueExt<>() instead:

cache.SetValueExt<SOOrderExtension.usrSignatureRequired>(row, true);

and now it’s updating the checkbox check for me. SetValueExt must perform the callback on its own somehow. I guess I need to remember to use each of these methods in the appropriate situation.

Upvotes: 2

Related Questions