7 Reasons for Our Salesforce Success

At work, I manage a team that provides technology solutions to several small but important departments within my organization. In the not-so-distant past, others in my role resorted to using tools like MS Access (hardly scalable), Spreadsheets (not easily shareable), and innovative uses of file shares and email templates to get the job done.

Along came Salesforce.com, and we have been able to create solutions that can withstand the demands of many users and data, promote collaboration, and maintain data integrity in ways that departmental solutions have been unable to accomplish in the past. Below are a list of reasons why our business unit’s implementation of Salesforce (aka Force.com)  behaves like an enterprise application. (In the future, I’ll publish a list of Salesforce criticisms, but today I’m a fanboy).

  1. Salesforce was an easy sell. With a greater percentage of the costs known up front, Salesforce takes some of the guesswork out of costing a solution. No hardware to purchase, no network engineers to engage, and no obtuse licensing makes Salesforce seem less of a fiscal gamble. In my case, I do all the development work, so we don’t even have to worry about a pricey consultant engagement.
  2. Salesforce helps the business to easily share information between and among departments. I have found that sharing information has become one of the biggest selling points of implementing Salesforce. After we implemented our first application in Salesforce, we found that other departments within the business unit wanted to use that data to help satisfy their own business needs. Instead of generating spreadsheets to share with other departments, we immediately began bringing on other areas so they can share data at the source.
  3. Salesforce provides the tools to quickly prototype, rollout, and change applications. Most business requirements can be met simply through a point and click interface. Although nothing replaces thorough analysis when developing an application, the basic concepts behind Salesforce administration is intuitive and its developer interface is streamlined. This shortens the cycle time for development and allows the business to see their changes implemented quickly.
  4. Salesforce takes IT out of the equation. Departmental solutions always lose when they have to compete with enterprise applications. IT just doesn’t have the resources to take on all applications and solutions for all departments. Thus, the needs of smaller business units can not always be addressed in reasonable timeframes. Salesforce allows departments and business units that don’t have the attention of IT to effectively roll out solutions without IT resources.
  5. Salesforce provides quick reports and dashboards to measure and communicate our accomplishments. A couple weeks ago, a business user asked me to generate a Salesforce report for the preceding fiscal year. It was in her inbox in about 5 minutes. The last year’s report took two days to gather the data and a day to crunch the numbers. Also, I’ve created dashboards that are visible at login that immediately remind users that their data actually means something in aggregate. With these types of reminders, managers and executives can’t argue with the benefit of Salesforce.
  6. Salesforce makes it easy to engage users in the development process. After meeting with users in the morning, I can go into a developer sandbox, make a change, and show them the change by lunchtime. With that kind of speed, users stay engaged and feel comfortable asking for changes. The first thing I tell new user groups (after I tell them that Salesforce is NOT a sales application) is that the application is THEIR application and that we can work together to create an application that fits their needs.
  7. Salesforce has a primetime feature set. Workflow, custom webpages, approvals, triggers, granular permissions, forms, reporting, dashboarding, and email parsing are all functionalities that we use in our departmental solutions–and we are just scratching the surface. These features have allowed my little department to develop applications that are producing real value to my business unit and the organization as a whole.

The above items (along with a lot of hard work) have helped to make Salesforce a valuable tool for my business unit. It’s not a perfect implementation (maybe I’ll write about that in the future), but we’ve been able to leverage the strengths of Salesforce to create departmental applications that provide enterprise-grade functionality and productivity.

Posted in Salesforce | Leave a comment

Why I bought my iPad (or the nook color as a gateway drug)

I was holding out as long as I could before I bought my iPad. I had a nook color, which helped me to triple my reading volume over the last year. I loved reading books on that thing. I was downing Fiction, non-Fiction, and Genres I never thought I could like at a faster pace than I have ever read.

Then, Barnes and Noble opened their nook app store.

Big mistake.

They turned my awesome reader into a tablet wannabe.

I loved my nook color, and I so much wanted to believe that my innovative little ereader from the big box bookstore had become a true tablet. I downloaded Angry Birds and a couple overpriced apps, but to my frustration, I never really found anything fun or useful. I knew, though, that I needed more apps. I went as far as pseudo transforming my nook color into a junior Android tablet using an n2a (nook2android) card. That made my once beloved nook color into a desperate attempt at joing the world of tablets. I now had access to a whole new world of apps that consistently crashed my poor inadequate tablet.

I wasn’t sure if android just had way too many configuration options, if the nook just wasn’t powerful enough to handle an unleashed android platform, or a little bit of both, but I did know that the iPad “grass” looked a whole lot greener.

Now that I’ve had my iPad for about a month, I’m ready to go out on a limb and declare it “amazing,” “revolutionary,” and (even) “productive.” AwesomeNote is just about awesome; zite is a beautiful and intelligent way to read my news; my email is delivered without a hitch. My bluetooth keyboard, has in effect, turned my iPad into a computer. Here’s the clincher: I’ve been on my iPad all day, it’s 10:00 at night, and I have only used 40% of the battery. WOW! It’s the best piece of hardware I’ve ever owned.

So, why do I miss my nook color? Well, I haven’t read one complete book since I bought my iPad. It’s too big and bright. I find that I can’t fall asleep after reading a couple chapters from a novel. I’ve tried turning on the black background and dimming the display, but it’s just too uncomfortable for me. So, althought I love my iPad and do not regret purchasing it, it is not a replacement for a good ereader.

I’m interested to see how the Kindle Fire is able to stand up to the iPad. If it’s a great ereader and a more fully baked tablet than the nook color, the iPad may no longer be king.

Posted in Software reviews, Tools | Leave a comment

Salesforce tip: Compose formulas in Excel first

I was working on a fairly complicated formula in Salesforce and realized that it may be easier just to build in Excel. As many of the formula conventions in Salesforce are the same as Excel formulas, this little trick can save a heap of time.

Steps:

  1. Name your cells.  For every field that you’ll be using in your formula, name a corresponding cell in Excel with the name of that field. Don’t forget to include “__c” for custom fields (see below). 
  2. Put some data into each of these named cells.
  3. Build your formula, making sure to click on the named cells to insert into your formula.
  4. Make sure the calculations work as designed.
  5. Copy formula from Excel and paste into Salesforce!!
Posted in Salesforce | Tagged , , | Leave a comment

Preparing for Life

Recently, Seth Godin blogged about “What’s high school for?” He listed a 10 super skills we should be teaching our kids in high school.  Including some of my favorites:

The power of being able to lead groups of peers without receiving clear delegated authority.

Project management. Self-management and the management of ideas, projects and people.

An insatiable desire (and the ability) to learn more. Forever.

Thinking back to my high school days in a top-notch high school with fantastic teachers, very few of these skills were explicitly addressed (except maybe public speaking, critical thinking, and the scientific method).  I’m sure some of the gifted teachers tried to impart some of the other ideas into our hard headed teenage brains, but there was no explicit discussion about most of the items in Seth’s list.

Few of the items on Seth’s list are controversial, but many of these skills are difficult to measure (e.g. how do you test for “self reliance?”)  In a climate of teaching to the test, we (parents, politicians, educators, etc.) should figure out how to address the life skills in Seth’s list while preparing our children for careers in the 21st century.

As a parent, I’m am helping my elementary school aged kids (why wait for high school?) to begin the process of chipping away at some of  the ideas on Seth’s list.  I hope we can find a way for our teachers and school districts to do the same.

 

Posted in Uncategorized | Leave a comment

Getting Sharepoint to talk to Salesforce on the Cheap: Part II

This is the second and last part of a series of posts that explains how to create integration between Salesforce and Sharepoint without using web services or an off-the-shelf product. The key parts of this solution includes:

  1. Creating a method of passing data from Salesforce to Sharepoint. We completed this task in the previous post, by creating a button that sends the user to a document upload page in Sharepoint while passing Sharepoint some query string variables to help prepopulate the edit form.
  2. Creating an object in Salesforce that will hold data about the document. (We created the object in Part I, but we’ll be updating this object to include the link to the sharepoint document in this post).
  3. Creating a method to send Salesforce information about the newly uploaded document in Sharepoint. This is the task that we’ll be working through in this post.

There are four items covered in this post:

  1. Setting up Email Services in Salesforce.
  2. Setting up Sharepoint to send an email to Salesforce with the data to be parsed.
  3. Writing the Apex class to parse the email.
  4. Updating the Document Object in Salesforce to include the link back to Sharepoint.

Setting up Email Services in Salesforce

Email services in Salesforce is a handy way of accepting emails from people or systems and using those emails to create or update records in Salesforce. More information about email services can be found on the Salesforce developer site, and an excellent example code can be found here.

The first step in creating the email service is to create an Apex class. We won’t be writing the whole code now, but we’ll just create the placeholder for an Apex class called ProcessSPDocs:

global class processSPDocs {
}

Once the class is created, go to: Settings > Develop > Email Services > New Email Service.

Fill in the appropriate fields making sure to select the new Apex class we just created. The “Accept email from” field provides the ability to allow emails from certain domains or specific email addresses. Before completing this form, do NOT forget to check the “Active” checkbox!

After completing this form, press the button “Save and new email address.” In the subsequent page, identify the prefix of the email address (the part before the @) and press save. Copy the email address and have it handy for the next step.

Setting up Sharepoint to Send Data

For those familiar with Sharepoint workflows, this step is very straightforward. Using Sharepoint Designer create a workflow that will send an email to the address created in previous step. This workflow should fire as soon as a record is created (i.e. when the document has been uploaded). In the subject of the email insert the following pieces of information.

  1. Document Name. The Document name will ultimately be used to create the link back to Sharepoint.
  2. Salesforce ID. The Salesforce ID was originally sent to Sharepoint and stored in the document library. The Salesforce ID is needed to identify to which record the documents will be associated.
  3. Document Type (Optional). If you’ll be storing a variety of document types, you may want to categorize them by document types (e.g. Contract, MOU, Other, etc).

The email will be sent to Sharepoint in the following format:

Apple Contract,002R000000ILiP7,Final Contract

Writing the Apex class

Using the Apex class you created above insert the code below (or something similar). This Apex class will be parsing the email that we just created in the previous step.

The Code used to parse the email and create a new record in the Document object is below.

global class processSPDocs implements
Messaging.InboundEmailHandler {

Document__c[] newDocument = new Document__c[0];

global Messaging.InboundEmailResult handleInboundEmail(
Messaging.InboundEmail email,
Messaging.InboundEnvelope envelope) {
Messaging.InboundEmailResult result =
new Messaging.InboundEmailresult();

String[] emailsub = email.subject.split(',',0);
String spDocName = emailsub[0];
String sfID = emailsub[1];
String spDocType = emailsub[2];

try
{
newDocument.add(new Document__c(Sharepoint_Document_Name__c=spDocName,
Account=sfID,
Document_Type__c=spDocType));
insert newDocument;
}
catch (System.dmlException e)
{
System.debug('ERROR: Not able to create Document: ' + e);
}
return result;
}
}

Updating the Document Object in Salesforce to include the link back to Sharepoint

The process is almost complete. The only thing left (which I forgot to include in Part I) is to put a url field into the Document object that will link back to the Sharepoint document. To do this, create a formula field with the following:

HYPERLINK("FULL SHAREPOINTPATH BEFORE THE DOCUMENT NAME"&
Sharepoint_Document_Name__c,Sharepoint_Document_Name__c ,"_blank")

Wrapup

Although it takes a number of steps to get here, this project should successfully integrate Salesforce and Sharepoint without needing any backend Sharepoint development or webservice development. Below is an example of how the new Documents object will look as a related object. Clicking on the link will open a PDF, and the average user will not even know that they are pulling the document from Sharepoint!

Posted in Development, Salesforce, Sharepoint | 13 Comments

Getting SharePoint to talk to Salesforce on the cheap – Part 1

At work, we are using Salesforce.com to meet the needs of several departments. We’ve extended the platform to not just manage CRM data, but to track other business processes as well.  We also use Sharepoint to manage documents, publish dashboards, and maintain our event calendar.

On several occasions, I have expressed my desire for Salesforce and Sharepoint to talk to each other, but apparently it’s not that easy to do without developing web services or purchasing off the shelf solutions. Both of these paths are currently off the table for my small team, so we went a different direction with the tools that are available in Salesforce and Sharepoint.

Background

We have been using attachments functionality in Salesforce to keep documents with their corresponding records, but we have found that attachments are a less than optimal way to manage documents, because they are not searchable and they are difficult to export en masse if we need to move to a different Salesforce instance (we will soon).    We have also looked at Salesforce Content Management, but it takes too many clicks for users to upload files and attach the files to a record.  (We could do some custom stuff to make this work, but we don’t have the time or resources).

Solution

So, we decided to use Sharepoint as our document manager and provide links in Salesforce that reference the Sharepoint documents.  We figured out a relatively quick and easy way of doing this that includes the following steps.  Only the first two steps are manual. (see below).

The ingredients needed to make this work include:

Starting in Sharepoint:

  • Create a Document Library in Sharepoint with at least a field to house the Salesforce ID and Salesforce Name.  We also created a Document Type field (e.g. Contract, MOU, Application, etc).
  • Create a custom edit form (copy the editform.aspx), and place a Content Editor Webpart below the form.  In the CEWP add a javascript that parses a query string. (See below – Thanks to Josh for putting this together).
<script src="/_layouts/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript">// <![CDATA[

	$(document).ready(function(){

		var sfID = GetUrlKeyValue('SalesforceID');
		$('input[title="SalesforceID"]').val(sfID);

		var SFRecordType = GetUrlKeyValue('SalesforceRecordType');
		$('input[title="SalesforceRecordType"]').val(SFRecordType);

		var SFName = GetUrlKeyValue('SalesforceName');
		$('input[title="SalesforceName"]').val(SFName);

	});
// ]]></script>
  • Make the Custom Edit Form the default Edit Form for that library.

Moving to Salesforce:

  • Create a custom object called Document and include Document Type as a field and a lookup field to the object to which you will be attaching the documents. (e.g. If the document library will be housing documents related to Accounts, then add a lookup field to Accounts object.)
  • Create a “New Document” button in the Document object with a URL to directed to Sharepoint. You can get the beginning part of the URL by uploading a new document into your Sharepoint List and copying the URL in the address bar. It will look something like this:

http://SiteCollectionName/SiteName/_layouts/Upload.aspx?List=%7BD9F024A7%2D3E1D%2D4475%2D890F%2D973E19D5E997%7D&Root Folder=%2SiteName%2FSalesforceDocuments&Source=http%3A%2F%2F newsource%2Eapollogrp%2Eedu%2FGovtAffairs%2FGATeam%2F SalesforceDocuments%2FForms%2FAllItems%2Easpx%3FFilterField1%3D SalesforceID%26FilterValue1%3D{!Account.Id}&SalesforceID{!Account.Id}& SalesforceName={!Account.Name}

This will generate the url that will be parsed by the code above in the Sharepoint CustomEditForm.

  • Go to the Account Object Page Layout (or whichever related object to which you will be attaching your documents) and make sure that the Documents Object is showing as a related list.  In the Document Object, select the new button that you created in the previous step.

Congratulations, you just created a way to upload new documents Sharepoint from Salesforce.   Give it a try.  Go to an account and click the “New Document” button, and you’ll be taken to your Sharepoint site, where you can upload a new document.  The Salesforce ID and Document Types should have been passed to the Sharepoint form as well.

But we are not done yet!  Next we’ll learn how to send back the Document information from Sharepoint to the Document Object in Salesforce using workflow in Sharepoint and Email Services in Salesforce.  Once complete, the document information will show up in the Account Page Layout on the related Document list with a link directly to the actual document in Sharepoint.

Read Part II.

Posted in Salesforce, Sharepoint | 1 Comment

What if you could do it all over? [Good Book]

Ever thought about going back to that one critical moment or decision you made when you were 18? Maybe it was about a girlfriend/boyfriend; or a class you took; a bet you made (or didn’t); or a vacation you took.

Jeff Winston, a troubled Radio News Producer dies at the young age of 43 in the first pages of Replay by Keith Grimwood and immediately wakes up in his 18 year old body in 1963. He remembers everything from his previous life and decides very early on that he will not make this new life a copy of the last go around.  He capitalizes on his knowledge of current events and his
lessons already learned. By the time he dies again in 1988, he leaves a legacy much different from his previous life.

This cycle continues (with a some powerful wrinkles along the way) with Jeff taking different paths each time.  I read the last page (on my new nookcolor) over a week ago, but I keep thinking about the plot twists in the book as well as my own life’s plot twists.  What decisions would I make if I was all of a sudden 18 again?

Replay is so thought provoking because it weaves so many themes into the relatively short book.  In fact, the one major criticism I have of this book is that it is too short.  There was one part of this book that foreshadowed some potentially sinister events, but was not addressed in subsequent lifetimes.  Also, there was one specific relationship that was not resolved, but showed promise for even more twists and turns.

Nonetheless, this book is page turner that keeps on turning even after the last pages are done.

Posted in book review | Leave a comment

My 2010 Professional Development Retrospective

Looking back at 2010 (we can do that now, right?) I’m proud of my professional development.  I’m lucky to have a boss that (with the appropriate rationale) supports my professional development.  In 2010 I was fortunate to attend two conferences, two training courses, and develop some new skills on my own.

Courses and Seminars

This year I went to one technology conference and enrolled in one personal development seminar. Both were valuable experiences that have helped me to make good decisions and foster collaboration.

  • Technology of Participation Facilitation Methods course offered by Partners in Participation. This two-day class was the highlight of my professional development this year. The course focused on three powerful methods for faciltation: Focused Conversation, Consensus Building, and Action Planning. Anyone who facilitates meetings or conversations should attend this training. I walked away from the training with three new facilitation tools and tons more confidence than I had before the training started.
  • Scrum Master Certification Course.  My company offered a Scrum Master certification course as part of our IT department’s push toward becoming an Agile shop.  Although I had participated in Agile projects in the past, I had no formal training.  The Scrum Master course gave me some great insight on some of the intricacies of Agile development.

Conferences

  • SharePoint Technology Conference (also known as SPTechCon). This conference allowed me to see how other organizations and professionals are utilizing the powerful Sharepoint platform. I was able to meet with other business evangelists who have similar roles as I do, as well as learn some practical Sharepoint solutions that were immediately applicable when I got back to the office.
  • Dreamforce. 2010 was the year that I become a cloud evangelist.  I have spearheaded the design of two Salesforce applications and am gathering requirements for another one.  These projects helped me to justify my attendance at the annual Salesforce.com user conference.  This conference was one of my highlights of 2010: the sessions were educational and insightful; the Vendor Expo was eye opening; and the “extras” were phenomenal (Bill Clinton, Stevie Wonder, will.i.am).

Technology “Upgrades”

The formal conferences and training were well worth their prices of admission, but the majority of my professional development was advanced by plugging through tutorials and combing through blogs and websites.  I soaked up as many Salesforce tutorials I could find on the Salesforce.com training site.  In the last year I went from zero knowledge of Salesforce.com to having a strong foundation in the Force.com platform.

Also, I continued to tune my Sharepoint knowledge by actively involving myself in Sharepoint projects throughout the year.  I have been a voracious reader of endusersharepoint.com, Marc Anderson’s Blog, Path to Sharepoint, and other blogs.

Other Professional Development

Some other areas of development this year include:

  1. Balanced Scorecard: I studied the Balanced Scorecard approach and helped my department implement some goals, objectives, and key performance indicators. The was a great exercise for me and it helped our entire department reevaluate our strategies.
  2. Reporting: I helped my staff and our customers to implement some key reporting initiatives.
  3. Business Process Management:  Always my passion, I continue to stay up to date on the writings of Steve Towers, BPTrends, and a bunch of LinkedIn groups (e.g. BP Group and BPM Guru).

2011 and Beyond

I’m proud of my professional development this year and look forward to 2011.  Some professional development goals next year include getting some formal Salesforce training as well as some management development courses.  In the upcoming year, I also plan on participating in some local professional groups including the Arizona Association of Facilitators and the local Salesforce user groups.

Posted in Development, Uncategorized, Year in Review | Leave a comment

Creating an RSVP template in Sharepoint (Part II)

In the last post I outlined how to setup the lists and newform.aspx for the RSVP template.  Let’s test to make sure the form is functioning, then we can complete the project by tying off some loose ends.

Testing the form

To test the application, create an event in the Event List.  Be sure to populate all the fields.  Once the event is create, type the url of the form we just created into the address bar of your browser and add “?SelectedID=1″ to the end of the url.  If you see information about the event on the top part of the form, you’re in good shape.

Go ahead and enter something in each of the fields, and submit the form.  Then check the RSVP list to make sure that the record was correctly inserted into the list.  The most important part of this test is to make sure that the correct event was identified in the new record.

Other (Optional) Stuff

Generating the RSVP url

I created the RSVP template to allow business users to create an RSVP form without IT support. My hope is that I will be able to step out of the RSVP business and make all the tasks self service.   For example, it’s not readily apparent to the average user how to get to the form for a given event, so I created a way to automatically generate the url.   The url for each event has three components.

  1. The link to the newform. It should be something like: http://sitecollectionname/sitename/listname/dynamicnewform.aspx
  2. The ID of the event. This component of the url will be SelectedID=X.
  3. The Source. The page to which the user will be directed after submitting the form like http://sitecollectionname.

The end result would be:

 http://sitecollectionname/sitename/listname/dynamicnewform.aspx?SelectedID=X&Source=http://sitecollectionname

To create this link automatically, create a calculated column in the Event List.  The calculated column will pull from the system created ID field and the field “Redirect after submitting” which was created in Part I:

=Concatenate("http://sitecollectionname/sitename/listname/dynamicnewform.aspx?SelectedID="&[ID]&"&Source="&[Redirect after submitting])

Creating the workflow

The last part of this process is to create the workflow.  The workflow is not required, but it increments the total number of slots left so the system can identify when the event is full or when a registrant should be placed on a waitlist.  Specifically the workflow should increment the field “Number of Places Used” in the event list.  When the Number of Places is greater than number of Places Available, an email would go out to the recipient explaining that he/she has been waitlisted.

That’s it! I hope this is helpful to those who create these types of forms. If you have any questions, please comment below.

Posted in Sharepoint, Uncategorized | 1 Comment

Creating an RSVP template in Sharepoint (Part I)

***Alert: If you don’t use Sharepoint, you will find this post irrelevant***

As part of my day job, I spend a fair amount of time working in Sharepoint.  It’s not a perfect application,  but it allows people without any programming skills to build usable applications that only a couple of years ago would have been the responsibility of IT departments.
Occasionally, I get requests to create RSVP forms for employee events.  It’s not a very difficult request, but it takes some time to complete.

  1. Create a list that will hold all the RSVPs.
  2. Create a list that will information about number of slots available for the event.
  3. Spruce up the form to include banner.
  4. Develop a workflow that will increment number of slots remaining.
  5. Develop a workflow that sends out a confirmation email.
  6. Develop a workflow that puts people on waiting list (status=waiting list) if the event is full.

All told, the process can take anywhere between two hours to four hours to develop, test, and get user acceptance.  Over time, these projects add up, so I wanted to create an application that would setup these RSVPs dynamically.   My goal was to make it easy enough so a non-techie could set up an RSVP in under 15 minutes.

High Level Overview

It takes a little bit everything to get this built (i.e. javascript, workflow, data view web parts filtered based on parameters, etc), but in several hours time, this RSVP engine will run itself.

In the form above, the title, image, and text below the image are all related to the specific event. The fields in the form will be used for all events.

High Level Components:

  • Event Info List (easy)
  • RSVP List (easy)
  • Customized NewForm.aspx (moderately complex–you’ll need access to Sharepoint Designer)
  • Workflow to generate a link to an event’s form. (easy)
  • Workflow to increment number of slots left. (easy)
  • Workflow to send confirmation emails. (easy)

Step 1: Create Event Info List

The Event Info List will contain all the information about the list.  I setup my list to include the following fields:

The calculated column “Number of Places Left” uses the following formula:

=[Number of Places]-[Number of Places Used]

An explanation for how to setup the other calculated column (Link to RSVP form) can be found in Part II.

Step 2: Create the RSVP list.

This list will be where all attendees for all events will be stored.  At the minimum, you’ll need a lookup to the Event Name field in the Event Info List, the name of the attendee and a status field.  Some other suggestions include Name of Manager, Phone Number, and email address.

Step 3: Customize the newform.aspx (actually create a new “newform”)

This is the most complicated step of the project.  There are several parts to this step.

  1. Customize the RSVP form.
  2. Create a Data View Web Part pulling data from the Event List. (Remember the RSVP form is static, but the information about the event is dependant on chosen event.)
  3. Setup Parameters and Filter so the approriate event is selected on the Data View Web Part.
  4. Update the form (with a Content Editor Web Part) so that the appropriate event is selected on the RSVP form.

Part I: Customize the newform from the RSVP created in Step 2.

Although I’m not going to explain the process of customizing/creating a newform.aspx, a simple google query came up with some of the following walkthroughs:

http://www.risetime.com/blog/archive/2009/06/03/create-a-custom-newform-aspx-for-a-sharepoint-list.aspx
http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx

Once the form is created, you can delete or move fields as necessary.  DO NOT DELETE ”EVENT NAME” FROM THE FROM.  The event name is needed to make sure that the RSVP is connected to the corresponding event.  We’ll hide this field in a subsequent step.  (See Section 2 Below)

Part 2: Create a data view webpart using the Event List

To add the event information create a data view webpart that shows data from the Event List we created in Step 1. (See Section 1 Below)

Part 3: Setup Parameters and Filter String

Once the two sections are setup, we have to setup Section 1 to return the appropriate Event based on a query string.  To do this, setup a Parameter for the data view web part in Section 1:

Then setup the Filter Criteria using the Parameterwe setup above:

Part 4: Update the form

Ok, so now we have the lists created and the NewForm created.  We’re almost done, but now we have to make sure that the form defaults to the correct event.  To do this, save and close your work in Sharepoint Designer.  Then open the form you just created in Sharepoint and add a content editor webpart.  Then insert the script below which will do two things:

  1. It will select the current event in the dropdown list.
  2. It will hide the event on the form.  (Once the event is selected, we don’t want users changing it.)
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("fillDefaultValues");
_spBodyOnLoadFunctionNames.push("hideFields");
function fillDefaultValues() {
var qs = location.search.substring(1, location.search.length);
var args = qs.split("&");
var vals = new Object();
for (var i=0; i < args.length; i++) {
var nameVal = args[i].split("=");
var temp = unescape(nameVal[1]).split('+');
nameVal[1] = temp.join(' ');
vals[nameVal[0]] = nameVal[1];
}
setLookupFromFieldName("Name of Event", vals["SelectedID"]);
}
function setLookupFromFieldName(fieldName, value) {
if (value == undefined) return;
var theSelect = getTagFromIdentifierAndTitle("select","Lookup",fieldName);
// if theSelect is null, it means that the target list has more than
// 20 items, and the Lookup is being rendered with an input element
if (theSelect == null) {
var theInput = getTagFromIdentifierAndTitle("input","",fieldName);
ShowDropdown(theInput.id); //this function is provided by SharePoint
var opt=document.getElementById(theInput.opt);
setSelectedOption(opt, value);
OptLoseFocus(opt); //this function is provided by SharePoint
} else {
setSelectedOption(theSelect, value);
}
}
function setSelectedOption(select, value) {
var opts = select.options;
var l = opts.length;
if (select == null) return;
for (var i=0; i < l; i++) {
if (opts[i].value == value) {
select.selectedIndex = i;
return true;
}
}
return false;
}
function getTagFromIdentifierAndTitle(tagName, identifier, title) {
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++) {
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
return tags[i];
}
}
return null;
}
function hideFields() {
var control = getTagFromIdentifierAndTitle ("select","Lookup","Name of Event");
control.parentNode.parentNode.parentNode.style.display="none";
}
function getTagFromIdentifierAndTitle(tagName, identifier, title) {
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++) {
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
return tags[i];
}
}
return null;
}
</script>

Now that the form is complete, some workflows must be created to tie all this together.  In the next couple of days, I will be posting information about how to setup the following functionality:

  • Generate a dynamic link to an event’s form.
  • Increment number of slots left.
  • Send confirmation emails.

To see the rest of this tutorial please go to Part II.

Posted in Sharepoint | 1 Comment