Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to pass a map from controller to javascript function in VF page

public String getButtonNameMap() {
  Map<String, Id> buttonNameMap = new Map<String, Id>();
  for(LiveChatButton chatButton:[SELECT DeveloperName FROM LiveChatButton WHERE DeveloperName =:buttonNamesSet LIMIT :Limits.getLimitQueryRows() - Limits.getQueryRows()] ) {
    buttonNameMap.put(chatButton.DeveloperName,chatButton.Id); 
   }
   return JSON.serialize(buttonNameMap);
}
Source by salesforce.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #How #pass #map #controller #javascript #function #VF #page
ADD COMMENT
Topic
Name
8+9 =