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
muronghemuronghe 

XXX

XXX



Message Edited by muronghe on 07-16-2008 12:08 PM
MattLMattL
If I had to hazard a guess, that custom field is a lookup field to the contact that is the Account Manager. If so, and you just have a checkbox on the Contact ID, it would be something like the following:

Code:
var qr=sforce.connection.query("Select Account_Manager__c from Account where Id='{!Account.Id}");
var acctMgr = qr.getArray('records');
var updateManager = new sforce.SObject("Contact");
updateManager.Id = acctMgr.get("Account_Manager__c");
updateManager.Account_Manager__c = 1;
var updateresult = sforce.connection.update([updateManager]);

Hope it helps, and good luck.
muronghemuronghe
XXX


Message Edited by muronghe on 07-16-2008 12:08 PM
MattLMattL
My apologies. I mis-read your post, and gave you the engine without the car body.

I'm sorry, but I can't really help ya more. Most people charge for full S-control development, and I'm sure my boss would have some choice words if I were to hand out a service we provide. :smileyindifferent:


A good starting point for me is always http://wiki.apexdevnet.com/index.php/Web_Services_API
Then scroll down to the AJAX Toolkit information.

I apologize that I cannot be more help.


Message Edited by MattL on 01-25-2008 11:11 AM
muronghemuronghe
I totally understand, thanks anyway

BtormarBtormar

What error message do you get? If you can provide some more information I may be able to help you.

If I understand your problem correctly, you'd like to have the 'Account Manager' field value copied to the Contact screen? Is this upon creation of a new contact? What triggers this S-control?

From looking at your code, it looks like you are setting the contact ID (updateManager.Id) field to equal to 'account_manager__c' - which does not appear to be a SFDC unique ID. It should probably be like this:

updateManager.Account_Manager__c = acctMgr.get("Account_Manager__c");

This part - "updateManager.Id" needs to equal the unique ID of the contact record you are updating, but again, I'm not exactly sure what you are trying to accomplish so it's hard to give anymore details.