First we have talked about the “do as server” function how to use it in synchronous and asynchronous way. Then we talked about the “today()” function issue processed through the server. We have not mentioned other functions not working and why they don’t work if we process them through the server.
What are these functions?
In fact they actually get executed but the reason is very simple why we don’t see them. Since we send the command to the server to execute it shows up on the server side not on our local computer. So we would need to execute these on our computer instead of the server. We can use synchronous programming, so this part of our code would be included in the “do as server … end” lines.
Why is it that I don’t use “do as server” and they still don’t work? If we write code into the “Table” or a “Field” “trigger after update” section then the code automatically will be executed on the server. Why? The answer is simple. This trigger could be a local trigger, from our computer, or an outside trigger. Since multiple computers, in different time zones, could be connected to the same account we don’t know what computer should execute the code. Or also could happen that non of the computers are on line so the code would not be executed. Because of these reasons the “trigger after update” codes always are executed on the server.