You need to sign in to do that
Don't have an account?
Grant Pestka 4
Related list onclick javascript to edit both child and the parrent record
I would like to use a button on a related list to update the selected child record and the related parent record at the same time. A previous search of the forum lead me to the Javascript that sucessfully edits the child record, but updating the parrent record seems to require a different approach. This is the code for the child record:
I have a check box on Lead (Scheduled_for_Interview__c) that I want to be set to false when the button is clicked.
Any ideas are appreaciated!
{!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} var records = {!GETRECORDIDS($ObjectType.Interview__c)}; var newRecords = []; if(records.length<1) { alert("Please choose at least one Interview to Cancel"); } else { var r = confirm("Click ''OK'' to remove the Lead from the Interview."); if (r == true) { try { for (var n=0; n<records.length; n++){ var sv = new sforce.SObject("Interview__c"); sv.id = records[n]; sv.Interviewee__c = null ; newRecords.push(sv); } result = sforce.connection.update(newRecords); window.location.reload(); if (result[0].getBoolean("success")) { alert("Interview Canceled"); } else { alert("failed to cancel Interview" + result[0]); } } catch (e) { alert(e); } } }Interviewee__c is actually Lead reamaned.
I have a check box on Lead (Scheduled_for_Interview__c) that I want to be set to false when the button is clicked.
Any ideas are appreaciated!