9

I have a custom object that looks up to Contact. On the Person Account Detail page, I have a custom button on the related list for this custom object. In production, this button references {!Contact.ID} which pulls the Contact ID of the Person Account.

However, in my Spring '13 sandbox, this no longer seems to work. The merge field is returning a blank value. I tried {!Account.PersonContactID} but this field is not accessible so I cannot save the button. Also {!Account.ID} will not work as I am using this button to populate the Contact lookup on my custom object.

Did something change in Spring 13 that caused this functionality to stop working?

  • Maybe not the exact answer to your question, but in Spring 13 they made Contact fields accessible in your PersonAccount formula field, so you could construct something there to get the value you need – Michael Welburn Jan 23 '13 at 2:40
1

I've done exactly what you wrote and I had the same awful results.

Options:

  1. Apparently Salesforce is inviting you to add an Account lookup relationship to your Custom Object, update that field for all your records and then delete the Contact field. This way you will not need to use any custom button.

  2. The only other thing that could work for you is creating a Apex WebService to retrieve the PersonContactId, the javascript button might look like this:

    var id = '{!AccountId}'; 
    var val = sforce.apex.execute("Utility","getContactId", {Id : id});
    

    Where Utility is your Class and getContactId your webservice, and inside your class the SOQL query:

    SELECT Id, PersonContactId FROM Account where Id = '001XXXXX'
    
|improve this answer|||||
0

Just across the same issue. There is a simpler way to do this for getting Contact Id from Person Account is to create a formula field on Account having value as PersonContactId and use this custom field to get the contact Id when creating any child record using custom list button.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.