Hello,
I have a gallery bound to collection.
Is there a way to implement an Afterchange (or maybe lostfocus, or something like this) event for a textbox?
The reason is that i want to change another value in the collection, depending on some restrictions.
The important columns are here "stunden" and "stunden_faktura".
If i change "stunden" and "stunden_faktura" is 0, than "stunden_faktura" should get the value of "stunden"
If i use the onchange event of the texbox stunden to do the following:
If(Value(txt_stunden_faktura.Value)=0,
Patch(col_Tat,
LookUp(col_Tat ,cr8ec_tatigkeitid=GUID(ThisItem.cr8ec_tatigkeitid)),
{
cr8ec_stunden_faktura:Value(txt_stunden.Value)
}
)
,false);
Then it start patching during i enter the value in the textbox stunden, but it should wait until i leave the textbox.
If you type very qucik it works but in normal use the value of stunden_faktura gets updated before the entering in textbox stunden is finished
I just inserted a classic textbox, but it executed the onchange event during typing, in the same way the modern control did.
I am working with a custom page in a model driven app. Maybe this behaives in another way than the pure canvas app?
Hi @SLMR ,
Classic text input runs the formula on OnChange after you're done typing and tapping elsewhere on the screen, which is different from modern text input.
If you want to change the way modern input controls work, I'm afraid it's unlikely. I recommend you add a "Submit" button and put the formula on the button's OnSelect property.
Thnkas for the quick answer.
But there is no onunfocus event
I am working with a custom page (canvas app) in a model driven app
Thanks for the quick answer.
But it does not change the behaivior
Hi @SLMR ,
Are you using modern control?
Please replace it with classic textinput control.
Best regards,
Rimmon
hey @SLMR
can you please try something like this:
// This is the Onselect event of the txt_stunden text box
If(
Value(txt_stunden_faktura.Text) = 0,
Patch(
col_Tat,
LookUp(col_Tat, cr8ec_tatigkeitid = GUID(ThisItem.cr8ec_tatigkeitid)),
{cr8ec_stunden_faktura: Value(txt_stunden.Text)}
)
);
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
MS.Ragavendar
20
BCBuizer
10
Super User 2025 Season 1
LC-26081402-0
10