CONTEXT(โHostโ) is always retuning โServerโ although I am running from a browser/editor.
Thatโs messing up my apps using the expression
Solved! Go to Solution.
Oh, this is interesting.
Notice that this is a Form view:
This is because a virtual column is calculated upon every sync. At first, in the Form, the Host Context is indeed Browser. But then when that VC is recalculated upon the next sync, it has been recalculated by the Server, so that value switches to TRUE. So youโre going to have to come up with a slightly different way to accomplish your goal here.
I would suggest getting rid of the [From Server] virtual column, and instead just put
CONTEXT(โHostโ) <> โServerโ
In the Required_If fields for the other columns.
Is the expression being evaluated during a workflow? Where is the formula being used?
I added in virtual coumn
Could you show a screenshot of where youโre using the formula?
What is your end goal? Are you trying to hide a view based on CONTEXT()? Restrict table permissions?
So I want to make a column required only when itโs opened via device or browser. If a row is inserted via API call, make the column not required.
So I have a column named โFrom Serverโ with the expression CONTEXT(โHostโ)=โServerโ . I make it virtual because there are multiple columns to use the condition.
So the columns with required condition NOT([From Server]) are not set as required because the virtual column is always returning true.
You can test it by add CONTEXT(โHostโ) and check its value in browser, device. All cases will return โServerโ
You really like the word, โsoโ.
hahaโฆ just realized it.
Following is screenshot from my test app.
Oh, this is interesting.
Notice that this is a Form view:
This is because a virtual column is calculated upon every sync. At first, in the Form, the Host Context is indeed Browser. But then when that VC is recalculated upon the next sync, it has been recalculated by the Server, so that value switches to TRUE. So youโre going to have to come up with a slightly different way to accomplish your goal here.
I would suggest getting rid of the [From Server] virtual column, and instead just put
CONTEXT(โHostโ) <> โServerโ
In the Required_If fields for the other columns.
Yep!
Sounds like a plan Thanks
If you use the โTestโ button from inside expression editor, I believe it will always return โServerโ, but it should be returning the correct value when actually in use.
User | Count |
---|---|
43 | |
26 | |
24 | |
14 | |
12 |