Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Include AJAX Toolkit 29.0 -->
- <script src="/soap/ajax/29.0/connection.js"></script>
- <!-- Set the Ajax client's session ID -->
- <script type="text/javascript">
- /* Get the session ID from the "sid" cookie */
- var sidRegExp = /sid=([^;]+);/;
- var sidMatches = sidRegExp.exec(document.cookie);
- var sid = sidMatches[1];
- /* Set the session ID for the Ajax client */
- sforce.connection.sessionId = sid;
- </script>
- <!-- Retrieve and display the organization to confirm success -->
- <span id="ajaxOrgName"></span>
- <script type="text/javascript">
- var results = sforce.connection.query("SELECT Name FROM Organization");
- var orgName = results.records.Name; /* Valid only when 1 record in results */
- document.getElementById("ajaxOrgName").innerHTML = orgName;
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement