How to change action caption dynamically?

I have defined a custom action in my page extension.

Is is possible to change its caption to ‘Enable’ or ‘Disable’ based on a condition in the code?

I’m using business central online.

You mean a PageAction? No that is not possible.

You would need to have two different actions and have them either visible or not.

Not possible to change captions dynamically. you want to change caption of the action or you want to use the action to change caption of a field?

Imran,

I want to change a caption of the action.

you might want to look at what [mention:61b2aa9ce72e429baa1ef43208ddbea4:e9ed411860ed4f2ba0265705b8793d05]has suggested

You can’t do it because CurrPage.Update (Refresh a webpage) does not work or at least I don’t how to get it to work either. So if your senario is like the following:

You want a button that start with the caption value “Release” and when the user click on the button then the Sales Header changes the Status to Release. Clicking on the button Releases the Sales Order and then you want the caption on the button to change to “Open”. With this you have only one button, but with two functions so to speak

This cannot be done :frowning: Because the page does not get Refreshed. If you close the page and then reopen it then you can get it to work, but only for that one record visible.

I 100% agree with it (I tried to do it in VSC and no luck). and property DataCaptionExpression with any function attached too

it does not work dynamically (like after currpage.update), but you need to close a page and open it again if you want to see changes.

I guess guys from MS has cache stored somewhere.