Saturday, November 3, 2012

Mobile Hotspot and Home Networking

Problem: I wanted to configure my home network getting internet from my mobile hotspot (i.e. my phone) the same way as if I were getting internet from a cable or dsl modem. My Netgear wireless router (WNR834B) did not want to act as a repeater for the mobile hotspot even though it is theoretically possible to turn it into a wireless repeater. If there's a way, I could not figure it out.

Solution: I bought a Netgear "Range Extender" (WN2000RPT). It was able to connect to the mobile hotspot and configuration was pretty easy. It also provides the usual wireless security I had with my wireless router, i.e. I can prevent unknown Mac addresses from connecting wirelessly. My PC's on the other hand can be hard wired into the ports on the back of the range extender.

One Caveat: One minor problem I had to solve was that I did not want my IP addresses to change if the range extender was not connected to the mobile hotspot. Out of the box, it's designed to configure itself dynamically and it was reverting to default network configurations when not connected to the hotspot. The simple solution was to go into the "IP Address Setup" (after it's connected to the mobile hotspot) and choose to "Use Static IP Address." That locks in the IP configuration.

Conclusion: so far it's working great with the following benefits:
  1. Communication between my two pc's is no longer routed through the mobile hotspot. This is (a) more secure and (b) a whole lot faster! And I do mean a very lot faster.
  2. The pc's can both connect wirelessly to either to the extender or the mobile hotpot -- and they still get the same ip address and are on the same network. But they can also be wired into the back of the repeater -- or both at the same time for Windows 7.
  3. Pc's can communicate with each other, even if the mobile hotspot is not up and running. So, when I leave the building for a while, my pc's can stay connected.

Saturday, October 13, 2012

Salesforce Sub Queries created by the Force IDE Schema Browser


Today my goal was to finally begin to understand Salesforce Sub queries which offer a very powerful way to fold multiple queries into one single query which helps reduce the number of SOQL queries in any given transaction so as to avoid bumping into the SOQL query limit. I finally figured out how to use the Force IDE schema browser to write queries. Once I had working queries, I started understanding what I was looking at.

So: how do we create a query that has a sub query with the Force IDE schema browser?

  1. Fire up the Force IDE. In my case, I start the Eclipse IDE with the Force IDE plugin installed, drill down to "salesforce.schema" in a Salesforce project and double click on it.
  2. The Opportunity object tends to be the master of many other objects and is a good object to start looking at. On the right hand side of the dialog under "Schema" find "Opportunity" and click on the triangle icon to expand. Next drill down into "Child Relationships."
  3. Find a child like "Note" and expand that drilling down to "Fields" and select one like "Note Id."
  4. Under "Query Results" to the left of the "Schema" window you've been working on, you'll see a query like:
    1. Select id,name, (Select Id From Notes) From Opportunity o
  5. Here is a query that accesses the Opportunity and three other detail objects for which Opportunity is the master:
    1. Select id, name, (Select Role From Partners), (Select CreatedDate From OpenActivities), (Select Id From Notes) From Opportunity o

If you're writing some apex code to access such queries, the sub queries become lists, so you might write something like this for the above example with notes and opportunity objects:

for ( Opportunity o: [Select id,name, (Select title From Notes) From Opportunity] ) {
    for ( Note n: o.Notes ) {
        System.debug(n.title);
    }
}

The schema browser offers a powerful way to start writing SOQL queries and create useful examples to work from.

Wednesday, October 10, 2012

Salesforce Sub Queries created by the Force IDE Schema Browser

Salesforce Sub Queries created by the Force IDE Schema Browser

Today my goal was to finally begin to understand Salesforce Sub queries which offer a very powerful way to fold multiple queries into one single query which helps reduce the number of SOQL queries in any given transaction so as to avoid bumping into the SOQL query limit. I finally figured out how to use the Force IDE schema browser to write queries. Once I had working queries, I started understanding what I was looking at.

So: how do we create a query that has a sub query with the Force IDE schema browser?
1.     Fire up the Force IDE. In my case, I start the Eclipse IDE with the Force IDE plugin installed, drill down to "salesforce.schema" in a Salesforce project and double click on it.
2.     The Opportunity object tends to be the master of many other objects and is a good object to start looking at. On the right hand side of the dialog under "Schema" find "Opportunity" and click on the triangle icon to expand. Next drill down into "Child Relationships."
3.     Find a child like "Note" and expand that drilling down to "Fields" and select one like "Note Id."
4.     Under "Query Results" to the left of the "Schema" window you've been working on, you'll see a query like:
1.     Select id,name, (Select Id From Notes) From Opportunity o
5.     Here is a query that accesses the Opportunity and three other detail objects for which Opportunity is the master:
1.     Select id, name, (Select Role From Partners), (Select CreatedDate From OpenActivities), (Select Id From Notes) From Opportunity o

The schema browser offers a powerful way to start writing SOQL queries and create good examples to work from.