Wednesday, June 24, 2009

salesforce insufficient privileges on custom page

I recently created a new custom apex page in SalesForce. It worked fine as an administrator but regular users were unable to find it.
All of the solutions I found assumed someone was pretty familiar with navigating the SFDC admin area so I figured I would give the path where the answer is located.

The page that helped me the most is here.

  1. Login as an administrator
  2. Click on the 'Setup' link on the left of the upper right hand side
  3. Under 'Administration Setup' in the left hand column, expand the 'Manage Users' list
  4. Click on 'Profiles'
  5. Click on the NAME of the profile you want to give permissions to ( under the Users area you can see what profile your users are assigned to )
  6. Scroll to the bottom of the page
  7. Click on the 'Edit' button for the 'Enabled Apex Class Access' area
  8. Move your new class into the enabled list and click the 'Save' button
  9. Scroll to the bottom of the page again.
  10. Click on the 'Edit' button for the 'Enabled Visualforce Page Access' area
  11. Move your new page into the enabled list and click the 'Save' button

That should be it, anyone in that profile should now be able to see the new page.

Wednesday, June 17, 2009

Cross Apply Incorrect syntax near '.'

I recently ran into an issue that had me puzzled for a bit.
I was using the new Cross Apply functionality in SQL 2005 and was getting the error:

Incorrect syntax near '.'

I checked and rechecked my syntax but couldn't figure out what I had done wrong.
After doing some googling I came accross this sqlteam post in which another poor guy had worked through the same issue.
He ended up figuring out that Cross Apply didn't work when the database was set to sql 2000 compatibility. It makes sense, though it might have been nice to get a more clear error message.

Armed with that information I looked up the code to change the db compatibility level, and what do you know my problem was solved.

Here is the code copied from the link above:
----SQL Server 2005 database compatible level to SQL Server 2000
EXEC sp_dbcmptlevel AdventureWorks, 80;
GO
----SQL Server 2000 database compatible level to SQL Server 2005
EXEC sp_dbcmptlevel AdventureWorks, 90;
GO

Monday, June 8, 2009

Colorado Technical University

I was recently reading on military.com and discovered that Colorado Technical University was one of their recommended colledges.
It seemed they favored CTU because the college not only had higher education courses and has a great distance educational program but also because the school takes special care to tailor itself to the service man/woman's needs. For example they allow the service member to put their education on temporary hold if they get deployed.


Getting such praise from the military is great for me since that just happens to be the college I graduated from. Now that I have joined the U.S. Army, when I want to continue my education I won't have any issue transfering education since they already have all my records.

Web Resource but no Embedded Resource

I was having a major problem trying to get an embedded javascript file registered.
The issue started because I was trying to port over Raj Kaimal's ( http://weblogs.asp.net/rajbk/ ) GridView client side reordering extender to the Data Grid. Since both controls are very similar the work wasn't difficult, however I was getting hung up trying to stick the .js file in my backend dll.

Searching google it seemed as though a lot of people got hung up in this area. I finally stumbed on Lee's post which directed me to Damian's blog

While niether of those posts directly solved my issue, Damian gave me the idea of using a reflector to see what the .NET view of my dll looked like. From that and a little luck I discovered that the proper syntax was:
[assembly: System.Web.UI.WebResource("[default namespace].[folder].[file name].js", "text/javascript")]

then for the script reference:
new ScriptReference("[default namespace].[folder].[file name].js", "[assembly name]");

most people keep the default namespace and the assembly name the same which makes things simpler but fosters a lot of confusion as to what the various parameters are really looking for.