function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HNT_NeoHNT_Neo 

Checkbox populate from other object

Hello, 

I have a custom object (ObjectA__c) and want add a custom field which will populate with a checkbox if true if IsActive  is checked on the standard User object. 

When I attempt to create a custom text formula field in ObjectA__c named ActiveUser__c with the following syntax in the Formula Option field, I receive the below error message, any ideas? 
$User.IsActive

Error: Formula result is data type (Boolean), incompatible with expected data type (Text).
Best Answer chosen by HNT_Neo
Lokeswara ReddyLokeswara Reddy
Hello JH,
$User.IsActive returns boolean value (True/Fales), but you are trying to use this in your custome TEXT formula field which is not correct. The formula for Text field should be a text value.
Eiterh 1. Change the formula return type as 'Checkbox' or
          2. If you want Text formula type then change your formula to return a text value, for example
              IF($User.IsActive, 'User Active', 'User Inactive')



 

All Answers

venkat-Dvenkat-D
You should use something like Owner.isActive or LastModifeidby.Active based on the user field you want to use to highlight the flag.
Lokeswara ReddyLokeswara Reddy
Hello JH,
$User.IsActive returns boolean value (True/Fales), but you are trying to use this in your custome TEXT formula field which is not correct. The formula for Text field should be a text value.
Eiterh 1. Change the formula return type as 'Checkbox' or
          2. If you want Text formula type then change your formula to return a text value, for example
              IF($User.IsActive, 'User Active', 'User Inactive')



 
This was selected as the best answer
HNT_NeoHNT_Neo

Thank you all for your help. 

I ended up doing this which pulled the actuall status of the user from the User object: 

IF (Owner:User.IsActive, 'True', 'False')

You all led the way to a great formula!