Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer 1

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

Option 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.

Option 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'

Hope it helps you

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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