Here is a simple example of how to easily achieve Ajax-functionality with Domino and Ext.js.
The idea is to, from a page that is opened in a web browser, call a Domino agent asynchronously and in the background to do some work and to provide feedback on it. The page is then updated when the work is done.
1. Download the Ext core (). This is a JavaScript library that among others contains functionality that can be used to achieve Ajax functionality easily.
2. Copy the contents from the JavaScript file ‘ext-core.js’
3. In your Lotus Notes database, create a Javascript library named ext-core.js and paste in the copied content from step 2.
4. Create a page with some Pass-Thru HTML.
- A button which when clicked on runs a JavaScript function ‘runAjax();’
- A div-tag in where the result from the Ajax query is displayed
<table> <tr><td><input type=”button” value=”Run” onclick=”runAjax();” /></td></tr> <tr><td><div id=”results”></div></td></tr> </table> |
5. Add a script tag in the ‘HTML Head Content’ section of the page to include the JavaScript library to the page.
| <script type=’text/javascript’ src=’ext-core.js’></script> |
6. Define the Javascript function ‘runAjax()’ in the ‘JS Header’ section of the page. This function calls an url, in this case a Domino agent, which is run. If the agent was run successfully and the call and response was successful we can decide what to do. Here we update a div on the page with the response from the agent, i.e. what the agent prints.
| function runAjax() {
Ext.Ajax.request({ url: ‘myController?openagent’, method: ‘GET’, success: function(response, opts) { document.getElementById(‘results’).innerHTML = response.responseText; }, failure: function(response, opts) { alert(‘server-side failure with status code ‘ + response.status); } });
} |
7. Create the agent ‘myController’.
The idea with the agent is to have it run the actual logic and that would be work with Domino data for searching or modifying for example. The agent could just do something with data but also send back information or status to the page that called it. In this example the calling page only runs the agent and the agent only prints a text line as a response or feedback.
Sub Initialize() Print “Foo bar” End Sub |
8. Done! Open the page in the web browser and click the button. The text ‘Foo bar’ should be displayed shortly in the div.
Note: This does not work in the Notes client, only in a web browser.
Tagged as:
ajax,
domino,
extjs,
javascript
by Sven R. Ohlson on December 28, 2009
in Aquarelle

It’s been snowing like mad here in Stockholm the last week. We have snow everywhere. Just this Saturday there was so much snow and I had to get my boat out of the water before the ice comes. There even was a thin layer – so it was time.
I got it up safe with the help of my father – and a lot of shovelling of snow too.
I thought about snowmen and decided to paint a little one when I got home. Here he is.
It is very beautiful with all the snow – and it really lights up the dark nights.
Tagged as:
snow,
snowman

I had to show this graphic photograph – it has of course nicely designed stairs – but it also has a very nice graphic look. The stairs lead up on to the next floor – and then finally – the very well made ceiling. The picture feels very powerful. Even though the main colours are yellow and black, the iron shapes really stand out and overtake the whole feeling of the picture. It almost looks inspired by Maurits Cornelis Escher’s impossible structures – “Ascending and Descending “.
Inspiring architecture!
Tagged as:
graphic,
huntera,
maurits cornelis eschers,
stairs
SOQL (Salesforce Object Query Language) is the language used in salesforce when writing Apex classes for example to retrieve sets of data.
SQL (Structured Query Language) is the language for managing data in relational database systems.
The two query languages are very similar but differ in different distinctive ways. In general SOQL is not as powerful as SQL and don’t have all the same functions. Here are three of the more imporant differences as bullet points:
- SOQL is only used to retrieve sets of data while SQL can directly retrieve and modify sets of data.
- SOQL can retrieve data from related Salesforce objects using extended dot notation. However the linking only works for pre-existing relationships. In other words SOQL can’t be used to join unrelated sets of data while that is possible with SQL.
- SOQL does not support the full set of SQL syntax. Some examples:
- ‘SELECT * FROM Account’
- ‘SELECT DISTINCT id FROM Account’.
-SELECT Id, Name FROM Account GROUP BY Name
Please feel welcome to add other differences or more examples of the limitation of syntax in relation to SQL.
Tagged as:
salesforce,
soql,
sql
by Sven R. Ohlson on December 21, 2009
in Cartoons

When I was drawing ducks the other day I had some different styles of ducks going. The last one I posted had a big beak – this one has a bigger beak.
The beak is very much the whole duck-head. Gives him a little kinder look than the earlier duck I drew.
There are many more ducks to come – stay posted. Or send me an e-mail if you are eager to see more sooner.
Tagged as:
beak,
cartoon,
duck

Me and my kids went for a trip to a bathing place last summer and while we went to buy some ice cream a nosy (and hungry) mallard came to us hoping for something to eat. If you look closely you can see some waffle on his neb that we gave him.
Although I really appreciate the snow that falls down now for christmas, it feels nice to think about the warm summer.
Hope he is ok now and not too cold (the mallard that is)…
Tagged as:
animal,
bird,
mallard
If you develop in Eclipse you change it in the meta data part of the class.

If you develop directly in the web browser, you change it in the version settings tab.

Each new version of Salesforce consists of a new version of the API which includes richer features and greater efficiency as it says in the help. So to be able to use new functionality you much specify a more recent API version. However, the API versions are backwards compatible.
Tagged as:
api,
api version,
meta data,
salesforce
by Sven R. Ohlson on December 14, 2009
in Cartoons

I have had a great day out in the archipelago. Really nice weather and I was getting a Christmas-tree for the living-room. Found a super nice one!
Here is a little cartoon duck I did last evening when I got home. He is looking really surprised when he sees the enormous tree…
I have done it in water-colour and ink. The water-colour gives nice shadings and extra life to the character.
Tagged as:
cartoon,
christmas,
duck,
ink

My mother was in Glasgow, Scotland, the other day. There she took this picture of a beautiful mineral called Hematite (a valuable ore of iron) – very creative I must say. Hematite has really nice colours and also shapes that absolutely inspire. This was displayed in the Hunterian Museum at Glasgow University.
I might use this in a nice background for a cool invitation or something like that – maybe for a coming new-year’s eve party or something similar!
Tagged as:
glasgow,
hematite,
mineral,
pattern
I wanted to create a simple XPages application for a specific purpose but since I haven’t learned that yet and didn’t have the extra time to do so either I had to go for the old style version. So I created a web form with some JavaScript and CSS. What I explain below is probably old news for most of you but I wasn’t aware of this so I’m sure there are others.
I created a form with passthru HTML and added combo boxes to be able to select values from. The values were taken from a DbLookup from a keywords view. This looked fine and also worked fine in Firefox and Google Chrome. But for Internet Explorer (7) the values wasn’t passed when clicking save and calling the submit function.
So I checked the source code and saw that the options lacked values. For Internet explorer the select box was built like this:
<select> <option>Value 1 <option>Value 2 <option>Value 3 </select> |
And hence no values were passed.
For Firefox and Chrome however the select box was by default built this way:
<select> <option value=”value1″>Value 1</option> <option value=”value2″>Value 2</option> <option value=”value3″>Value 3</option> </select> |
The workaround:
Since I didn’t need to save the values chosen but only needed them to save to other fields I could instead print HTML in a computed text that allowed the select box to print correctly also for IE.
Here’s the formula code for that:
tmp := @DbLookup(Notes:Recache;”":”";”LookupKeywords”;”Keyword”;”Values”); str := “<select id=’someId’ class=’comboboxCssClass’>”; str := str + @Implode(“<option value=’” + tmp + “‘>” + tmp + “</option>”); str := str + “</select>”; str |
Tagged as:
chrome,
combobox,
firefox,
internet explorer,
lotus notes,
select