You need to sign in to do that
Don't have an account?

Help with JAVA Script
I am trying to build two buttons that executes JavaScript.
The function of the first button is to remove multiple items below a related list.
The function of the second button is to update a field on multiple records below a related list.
The related list is a custom object that links Contacts with a Delivery custom object (many to many relationship)
The functionality of the first button, what I am trying to create, is to select multiple rows and press a button to delete the selected rows.
The code I am using is below

The second button should update a checkmark field called "Aanwezig" on the selected records. However I get the same error for the second button with the following code:
The function of the first button is to remove multiple items below a related list.
The function of the second button is to update a field on multiple records below a related list.
The related list is a custom object that links Contacts with a Delivery custom object (many to many relationship)
The functionality of the first button, what I am trying to create, is to select multiple rows and press a button to delete the selected rows.
The code I am using is below
{!REQUIRESCRIPT('/soap/ajax/35.0/connection.js')} var selectedDeelnemers = {!GETRECORDIDS( $ObjectType.Deelnemer__c )}; sforce.connection.deleteIds(selectedDeelnemers); navigateToUrl (window.location.href);However I get the following error:
The second button should update a checkmark field called "Aanwezig" on the selected records. However I get the same error for the second button with the following code:
{!REQUIRESCRIPT('/soap/ajax/35.0/connection.js')} var selectedContactIds = {!GETRECORDIDS( $ObjectType.Deelnemer__c )}; var contactsForUpdate = []; if (selectedContactIds[0] == null) { alert(“You must select at least one record”); } else { for (var i = 0; i < selectedContactIds.length; i++) { var contact = new sforce.SObject(“Contact”); contact.Id = selectedContactIds[i]; {!Deelnemer__c.Aanwezig__c} = true ; } } var saveResult = sforce.connection.update(contactsForUpdate); location.reload(true);What am I doing wrong here?
All Answers