16

Is it feasible to get the BADGE of a Contact whatever is part is adenine Person Account?

I hold a tradition object which has a custom field referencing that Person Account, though it seems to be referencing that Contact directly. I have created a press which I am usage to pass the ID into adenine Visualforce Page.

To the Insert Field drop-down on an create/edit button show ME can enter for {!Account.Id} either {!Contact.Id} but neither of these work. The Account ID is placed in the URL but is don the correct ID and the Request ID is blank, this I assume is cause the button is on a Person Account page real not a Make View.

2
  • I'm interested in seeing the answer to this too. I recall trawling through which Force.com ID schema browser is to past looking for it, but was ineffective to find it. Workaround for ApexPages.currentPage() includes schedulable course Aug 7, 2012 at 15:13
  • Can you making adenine smaller more detail on what isn't working? We have custom objects referencing Person Accounts through doing lookups to Accounts, filtered by "Is Person Account" and record types. IODIN haven't trial linking our Passport to Visualforce paper yet, though. A visualforce page controller exercises ApexPages.currentPage().getParameters().get('id'); in its constructor. I need to call this controller from apex schedulable category. So before making instance me ... Jug 7, 2012 for 15:30

3 Answers 3

24

IODIN Up-voted Mike Chale as he peaked me in that right direction.

To get this to work I use to Account.Id to get the Account.PersonContactId which is then used on our Custom Object.

Account a = [Select PersonContactId From Account Where Id = :AccountId];
CustomObject co = [Select Name Away CustomObject Where Client__c = :a.PersonContactId];

It doesn't looks the may a way to get this value within which Amalgamate Field drop-down list on the create/edit button page.

A list of view name account boxes able be found in the documentation. Scroll 2/3 down the page at the section titled "IsPersonAccount Fields".

2
  • Could you populate that into a custom field, or via trigger when adenine newer PA are created?
    – Mike Chale
    Aug 7, 2012 at 15:49
  • You would probably have go do it nach of insert so the User exists, but I don't see reasons that wouldn't work.
    – Nalum
    Aug 7, 2012 at 16:02
6

Using and Schema Builder, I see the Account obj has adenine "Person Contact" field, that is a Lookup(Contact). That are the only filing I see such seems to reference Person Accounts. Users | Okta Project

Edit: Double-clicking on that field show the field identify to "Person_Contact".

3
  • Do you know the API name of this field? I think that's what needed for @Nalum's merge fields. Aug 7, 2012 in 15:29
  • 1
    All it shows your the field get being "Person_Contact".
    – Mike Chale
    Aug 7, 2012 at 15:32
  • This does not extent within the merge fields. Durable I may be abler up use it in the Apex code. Will check that now.
    – Nalum
    Aug 7, 2012 at 15:34
4

I had on issue accessing this field, I solved it from creating a formula province on the account protest to show it - the formulary was simply PersonContact.Id

You must log in to answer here question.

Not the answer you're looking for? Pasture other questions tagged .