You need to sign in to do that
Don't have an account?
sunny.kapoor1306
apex
I have developed a page where all users are shown,field i have made is Selected user
Selected user is not working with custom fields but is working with standard fields
eg
I wrote Account_Owner__c=:selecteduser;
then its not showing the desired result
but when i use createdbyid=:selecteduser;
it shows the record
Is Account_Owner__c a lookup to a user object?
Hi,
Have you created any record in which you have selected the Account_Owner__c??? I don’t think that is not working for custom field. It will work for both.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
bob_buzzard
its a cross-obj formula(text)
Navatar_DbSup
there are many records which have account owner
thats what i am saying:when i use standared field equal to selected user it displays the user
but with account owner it isnt
Is it a cross object formula to a user id?
bob_buzzard
its a cross object formula for account owner
see Mr. Bob
I want to show the details of that item where account owner is equal to selected user i.e. the user which i select form the picklist only the account owner=selected user details shud b shown
Understood. And your cross object formula refers to the OwnerId field? Also, your picklist has values that are user ids?
bob_buzzard
bingo bob
so can u help pe in this?
I've just had a quick play around in my dev org, and it does work when used in this way. I've created a formula field on opportunity that points the to the account owner id, looked up my user id and then run this code through the 'execute anonymous' feature of the IDE:
which returned 37 records.
One thing to check - are the user ids that appear in your selectlist 15 or 18 characters? If its the latter, that may be the problem. Ids get case insensitized under certain circumstances, and as you will be comparing strings in the query, it won't match.
bob_buzzard
userid is standard field and u r giving name of a proper id
mine is account_owner__c=:=:selectedUser
if i use a standard field or write name of a particular user,it works
Mine is too - look at the code I posted - that is comparing a string representation of an id with a formula field, in exactly the way that you have described.
sunny.kapoor1306
Can you show the Formula for Account_Owner__c field?
i think by seeing that we can help..
Regards,
Shravan