hello everyone. How can I conditionally set the Pay button to not be visible when I select a specific payment method.
Best answer by aaghaei
View originalhello everyone. How can I conditionally set the Pay button to not be visible when I select a specific payment method.
Best answer by aaghaei
View originalI would expect to do this in the RowUpdated event. You can call the .SetVisible method of the button/action to show/hide it accordingly.
I believe the suggested even handler for UI controls status management is RowSelected and don’t forget to set CommitChanges = true for the driving field. RowUpdated will be triggered only if a change is made and if a document with the specific type is selected and no change is made the button will be visible. Please note there is a known issue in Acumatica that if a button is added to the user favorite, then always will be visible.
there are lots of samples on community or stackoverflow but here is one. You can set the true or false value on the fly based on your document type verification you are referring to.
https://stackoverflow.com/questions/44120573/disable-action-buttons-conditionally-aef
I think
In T210, in Step 3 there is an example around changing the enabled status of a field.
See if that helps you get started. Use the Ctrl+Alt keyboard shortcut to get the details on the Pay button. If it is defined as a PXAction (I would expect so) then you can use graph.action.SetVisible.
It was a while ago I studied the materials but if I am not mistaken, RowSelected event is triggered multiple times before and after other events including RowUpdated. So if the visibility control developed on RowSelected it should do the work without RowUpdated alteration.
Couple of points, if you want to do that via RowSelected:
As alternative, you can also try to use javascript. This link describes usage of js in scope of SignalR, but you can understand abou js as well.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.