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
RCE_JereriahRCE_Jereriah 

Field name for "Owner" field on Custom Objects

I have built a custom Commission Object and I use a Customer Button on Opportunity Line Items to populate data in a new Commission Entry. My sharing rules require Owner to be the Commission Payee so they can view their own commission information. I need to know how to force data into the Owner field on the Commssion Object. Really, I just need the appopraite field name--I can push data into fields. The only peice of the below code that doesn't work is the part relating to Owner.

 

 

{!URLFOR($Action.Commission_Tracking__c.New, null,
[
"00N50000001y1mA" = (100*OpportunityLineItem.OP_Commission_Rate__c),
"00N50000001y214" = OpportunityLineItem.TotalPrice,
"00N50000001y21s" = OpportunityLineItem.Link,
"00N50000001y227" = OpportunityLineItem.OP_Product_Name__c,
"00N50000001y22q" = OpportunityLineItem.Quantity,
"00N50000001y22v" = OpportunityLineItem.UnitPrice,
"00N50000001y23Q" = OpportunityLineItem.Cost_Floor__c,
"00N50000001y4HO" = OpportunityLineItem.OP_Opportunity_Record_Type__c,
"CF00N50000001y1zc" = Opportunity.Name,
"CF00N50000001y2RH" = Account.Name,
"OwnerId" = Opportunity.OwnerId,

"save"=1
],
true)}

 

Again, the above code works, but the Owner of the created Commision Entry is always set to the person who triggers the creation of the Commission Entry (clicks the Create New Commission Entry button).

 

I use Opportunity.OwnerId in another peice of the code, so I know that it is a viable field. So far, I've tried:

"Owner"

"OwnerId"

"!OwnerId"

"!Owner"  

"Commission_Tracking__c.OwnerId"

"Commission_Tracking__c.Owner"

"!Commission_Tracking__c.Owner"

"!Commission_Tracking__c.OwnerId"  

"!Commission_Tracking.Owner"

"!Commission_Tracking.OwnerId"

"Commission_Tracking.Owner"

"Commission_Tracking.OwnerId"

 

I've tried User Name and UserId values as the input for all of the above options. Everything returns the button pusher as the Owner of the new Commission Entry record.

 

Thanks in advance.

~jm

 

 

Message Edited by RCE_Jereriah on 04-09-2009 02:19 PM
werewolfwerewolf

You're not going to be able to do that like this because the Owner field is not editable on the edit page.  The owner is always defaulted to be the current user and can only be edited post-save.  You can only default values that are actually editable on the edit page.

 

If this is a hard requirement you might think about building a Visualforce page to edit this.

RCE_JereriahRCE_Jereriah

Oh, that is a real bummer.

 

Thanks for the information. For now, I'll deal with making the change after creating the Commission Entry. I might run a btach update with some code later.

 

Thanks again,

~jm