You need to sign in to do that
Don't have an account?
Carrlos Boyd
Show Full Name of record owner, or queue, in Related List
I have two custom objects: the parent is Object1 and the child is Object2. The child records can be owned by a person or a queue. In the related list on Object1, I need to combine FirstName and LastName into one field, therefore utilizing one column, but keep getting an error that "the field does not exist". Also, when the child record is owned by a queue, in the first name and last name columns is a hyphen (-). How can I show the full name or the queue name in the same column?
Thanks for the help!
All Answers
http://www.salesforce.com/us/developer/docs/api/Content/relationships_among_objects.htm
If you wanted to show the owner on the child object, you can create a formula field on child object reference like below. In formula, Insert Field will help you how reference parent Owner field Let me know if this helped
When an Object2 record is created and related to Object1 and the owner is a queue, I would like to change the queue owner of Object1 to the same queue owner of Object2. I can figure out the related list view later. The owner is more important. No matter if Object1 is owned by a user or a queue, when the Object2 record is created and is owned by a queue, I need the Object1 record to update to be owned by the same queue.
Hope this helps explain things better.
See if the below code help you. Since I don't have the actual object name and fields I have reference them accordingly as per your given reference. Please change them and I hope it help you I hope it help
You can give a try testing it and if you see any issues let me know
- Object1 is now "Sales_Region__c"
- Object2 is now "Area_Sales_History__c"
As I start trying to plug those values in, I get errors and I'm not familiar enough with triggers to figure them out.Also, just for clarification, I am putting the trigger in Area_Sales_History__c (Object2) although it's Sales_Region__c (Object1) that I need to be updated.
Error message:
"Error: Compile Error: Invalid character in identifier: Area_Sales_History__cList at line 3 column 40"
When my Processor Builder process ran on the Area_Sales_History__c record and assigned the owner as a queue, the owner of the related Sales_Region__c record did not change to the same queue. It did nothing.
Also, I noticed that when I tried to manually change the owner to a user or to a queue, this is the error I received:
Error: Apex trigger UpdateOwner caused an unexpected exception, contact your administrator: UpdateOwner: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a6w3D0000008SuDQAU; first error: INVALID_OPERATION, Queue not associated with this SObject type: []: Trigger.UpdateOwner: line 19, column 1
Review all error messages below to correct your data.
Apex trigger UpdateOwner caused an unexpected exception, contact your administrator: UpdateOwner: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a6w3D0000008SuDQAU; first error: INVALID_OPERATION, Queue not associated with this SObject type: []: Trigger.UpdateOwner: line 19, column 1"
After doing this run the code and the log will showup
Thanks for the help!
"So I mis-spoke in my explanation. I don't have a parent/child relationship because this would not let me assign the child object to a queue so I changed the relationship to just a look up. That being said....
When an Object2 record is created and related to Object1 and the owner is a queue, I would like to change the queue owner of Object1 to the same queue owner of Object2. I can figure out the related list view later. The owner is more important. No matter if Object1 is owned by a user or a queue, when the Object2 record is created and is owned by a queue, I need the Object1 record to update to be owned by the same queue.
Hope this helps explain things better"
I have been helping you with this and you haven't told me what happened to this one. Just for the curiousity would you kind to let me know, was my code able to help you with this logic and you never needed that. Thanks