I think, we can add only the fields in the current object(with the same data type) in formula fields. So you cannot do that.
There is a roundabout way to achieve this.
Create a field for UserId(say with data type Text) , add this field to the page layout and make it readonly in layout. Write a script to get the userid and populate this field in page layout and inject the script into it.
So whenever the user opens this page (using layouts), this script will run and populate the readonly field with userid, and when the user saves this page the userid will be saved into the record.
I had not done this before, but I think this is doable.
Hi
I think, we can add only the fields in the current object(with the same data type) in formula fields. So you cannot do that.
There is a roundabout way to achieve this.
Create a field for UserId(say with data type Text) , add this field to the page layout and make it readonly in layout. Write a script to get the userid and populate this field in page layout and inject the script into it.
So whenever the user opens this page (using layouts), this script will run and populate the readonly field with userid, and when the user saves this page the userid will be saved into the record.
I had not done this before, but I think this is doable.
best wishes
Jay