Getting a security token from your salesforce instance

Submitted by barnettech on Tue, 12/15/2009 - 17:17

To access Salesforce via a desktop application or other API-based application, you must replace your current password with a combination of your password and a security token:

1 Log in to Salesforce via the browser to request your security token.

2 Go to Setup -> My Personal Information -> Reset Security Token.

3 Click the Reset Security Token button to trigger an email which will contain your security token.

4 Select and copy the token from the email.

db_query in drupal .... creating sql queries the drupal way (Drupal 6)

Submitted by barnettech on Mon, 12/14/2009 - 10:23

good documentation is here: getting a single value: use db_result

This sites Drupal 7 wiki page for creating Drupal 7 queries is here:

$result=db_result(db_query('Select uid from {users} where uid = %d',5));

getting multiple rows: use db_query

Using the jquery library thickbox to have lightboxes

Submitted by barnettech on Thu, 12/10/2009 - 21:29

After opening a lightbox with thickbox: see

You can close the lightbox and have an href link open a url in the parent window:

Register for an Infinite Connection account.

Also to have a form and click submit but close the lightbox and have the form submit to the parent page use this code.

$output .= "

this took me an hour or two to figure out, so you're welcome :)

conditionally run code on page.tpl.php

Submitted by barnettech on Thu, 12/10/2009 - 21:23

I use the following code to conditionally show pieces of the page depending on which page the user is on:

$curr_uri = check_plain(request_uri());
//print $curr_uri;
<?php if ((!preg_match("/contact/i", $curr_uri))&&(!preg_match("/authentication-options/i", $curr_uri))&&(!preg_match("/node\/305/i", $curr_uri))) : ?>
conditional html code here
<?php or php code here to be conditionally shown?>
<?php endif; ?>