• kram322
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello!

I'm having trouble querying records related to my Person Accounts. I have a query in a visualforce extension on the Accounts object which gets information from its related Associations object on button click and serves it as a visualforce page:

[SELECT (SELECT Account_Associated__r.Name,Name, Contact__r.Name, Primary_Account__r.Name,Role_at_Current__c,Role_Status__c FROM Associations__r) FROM Account WHERE id=:stdCtrl.getId()];


I want to get the same data from my Person Account, however the query will not return any rows. I can query the data on the Contact record attached to the Person Account. However when the button is clicked Salesforce serves up the Id for the Account record on the Person Account. 

 

Is it even possible to do this or am I wasting my time?

Hello!

I've searched around and cannot find where I'm going wrong with this. I've created a custom list new button for a custom object Associations. This button is attached to the Associations related list on the Contact record page. 

I need to populate the new Associations record with field values from the Contact record, I'm running into difficulty passing the contacts "Account Name" value into the new field. I get the error message "Field Contact.Account.Name does not exist".

This is the URL i'm attempting to pass, the other fields populate fine, just the account name seems to allude me:

/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Contact.Account.Name}
&CF00N20000006TR7J_lkid={!Contact.Account.Id}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}

I've tried passing it numerous ways attaching __r etc. Either I'm missing something blindingly obvious or this isn't possible?

 

Help is very much appreciated!

Hello!

I've searched around and cannot find where I'm going wrong with this. I've created a custom list new button for a custom object Associations. This button is attached to the Associations related list on the Contact record page. 

I need to populate the new Associations record with field values from the Contact record, I'm running into difficulty passing the contacts "Account Name" value into the new field. I get the error message "Field Contact.Account.Name does not exist".

This is the URL i'm attempting to pass, the other fields populate fine, just the account name seems to allude me:

/a0A/e?CF00N200000064Q30={!Contact.Name}
&CF00N200000064Q30_lkid={!Contact.Id}
&CF00N20000006TR7J={!Contact.Account.Name}
&CF00N20000006TR7J_lkid={!Contact.Account.Id}
&00N20000006cmWu={!Contact.Title}
&retURL=/{!Contact.Id}

I've tried passing it numerous ways attaching __r etc. Either I'm missing something blindingly obvious or this isn't possible?

 

Help is very much appreciated!