Slaesforce FAQ

how to push list in another list in javascript+ salesforce

by Joanny Cummerata DVM Published 2 years ago Updated 2 years ago
image

Go to Setup – Customize – Contacts – Buttons, Links, and Actions and hit the “New Button or Link” button: Select “List Button” display type, “Execute JavaScript” behavior and “OnClick JavaScript” content source. It will execute our JS code on click.

Full Answer

How to execute JavaScript code on click in Salesforce?

Go to Setup – Customize – Contacts – Buttons, Links, and Actions and hit the “New Button or Link” button: Select “List Button” display type, “Execute JavaScript” behavior and “OnClick JavaScript” content source. It will execute our JS code on click.

How to create contact records using JavaScript in Salesforce?

So, let’s create the first button which creates a contact record. Go to Setup – Customize – Contacts – Buttons, Links, and Actions and hit the “New Button or Link” button: Select “List Button” display type, “Execute JavaScript” behavior and “OnClick JavaScript” content source. It will execute our JS code on click.

What is the use case for Salesforce classic JavaScript button?

These are examples for Salesforce Classic, if you want to know about updates to Javascript Buttons in Lightning Experience, check out this article. Use case: We need to automate the following actions. Quick Create a contact (allow user to enter contact’s name and use the phone number from it's parent account).

How to get selected records from selected contact IDs using JavaScript?

The Javascript code is similar to Quick Create but we need to get the selected records by using the following function: The GETRECORDIDS function retrieves the selected contact Ids and stores them in the selectedContactIds variable. But they are just Ids, not the records!

image

How to list contacts in Salesforce?

Salesforce List Buttons Javascript Example 1 Quick Create a contact (allow user to enter contact’s name and use the phone number from it's parent account). 2 Activate a set of selected contacts. The Status field should be set to “Active” and Last Contacted field should be set to today’s date. 3 Quick Delete a set of selected contacts. User should confirm changes.

What is saveResult in sforce?

The saveResult variable contains information about the result of the call to the sforce.connection.create () method. If the record creation is successful, it will contain the saved record ID and a “success” : “true” flag. Otherwise it will contain an error message.

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9