+ Start a Discussion

Java Script to update a custom field

We have created a custom object called Candidate Tracker and have created workflows to update various fields and create tasks but I am having problems with one field update. I would greatly appreciate any help that can be offered as  I am new to Salesforce and do not have much knowledge about writing JavaScript but I have managed to find some (code) out on the discussion boards that has been a great help.  So here is what I am looking for:


In the Candidate Tracker, I have created a button that when clicked opens an email template so we can forward a resume to someone.  The button is called "Submit Resume" and this is what the code looks like:


location.replace('/email/author/emailauthor.jsp?retURL=/{!Candidate_Tracker__c.Id}&p3_lkid={!Candidate_Tracker__c.Id}&p2_lkid={!Candidate_Tracker__c.Manager_NameId__c}&p6= Company Name- Resume&template_id=00X50000001RiCn&p5=');


Now I would like to also add an action that will update a Picklist Value in a field called " Company  Stage" from "Company Received Permission to Submit Resume" to  "Company Submitted  to Client". Can anyone offer me the JavaScript I will need to execute this action?


Please help!

Thanks in advance everyone!




In the Submit Resume code, add this line - "00N80000004gmgQ=Company Submitted to Client" where  "00N80000004gmgQ" is the Id of the picklist field and "Company Submitted to Client" is the value of the picklist field.


Let me know, if that works.




Thank you for responding so quickly!  I will definitely try this!  I am not sure where I find the Id of the picklist field, can you tell me where to locate this?  And does it matter where I add the new line of code?


Thank you so much!!!




I added the line of code you suggested and it didn't work.....  it may be where I placed it that is causing the issue though.  Will keep trying....


Happy Friday all!  I am still looking for the code to update a field when this custom button is clicked......

I have tried the code that Sureka suggested but did not have any luck with it.  Does anyone have any suggestions they would like to share?  I greatly appreciate any help I can get.


Thank you so much!