clearbasic
Gary Sherman
December 4, 2012

Last year I had to do some customizing of the Clarify attachment form (form 1006) for a customer. This is one of those old-school forms that doesn’t always behave very well with ClearBasic. I shared some of my findings and solutions on customizing this form.

 

I had a new request come up this week. How do I enable a user to add an attachment on a case that they don’t own?

Plan A

 

The first thought was simply to enable the buttons on the form.

 

 

The buttons were now enabled, but clicking the Add button raised an error, ” ‘{CurrentOwnerLoginName} is now the owner, therefore the ‘Save’ operation cannot be completed.”

 

image001 (5)

 

Bummer.

Plan B

 

There’s a bug


Gary Sherman
September 13, 2012

I’ve talked in the past about how to create custom events in Clarify/Dovetail, and how to fire business rules based on these events.

 

In short, code needs to be written that creates a custom activity log and time bomb.

 

A recent webinar covered details on how to do this: http://www.slideshare.net/gsherman/advanced-business-rules-part2 (starting on slide #18)

 

For additional info, take a look at the “User-defined Business Rule Events.doc” available on the Rulemanager wiki: http://rulemanager.wikispaces.com/How-To

 

If you also want to create a custom act_entry record, you’ll probably want a custom activity code. Here’s an example: https://gist.github.com/1042796

 

Change Priority

 

One of our customers recently wanted to do something similar, but for Change Priority of a case. They wanted to be able to fire a business rule when the priority of a case changes. They needed


Gary Sherman
June 4, 2012

The task at hand is to be able to click on a URL (such as clarify://case/12345) and that will open case 12345 in the Clarify client.

 

Custom URL protocols

 

In Windows, you can create your own custom URL protocols, which allow you to register an application to a URL.

 

In my previous post, I introduced a clarify:// URL protocol. Lets see how we can make that URL trigger the Clarify Client (clarify.exe)

There’s a MSDN article that outlines the basics of doing this.

 

Basically, you create a registry key that maps the URL to the application.

 

And you’re URL will be passed to the application as a parameter (that’s the %1).

 

Here’s a sample registry entry for this:

 

 

So, when I call a URL of clarify://something, clarify.exe will be started and the URL


Gary Sherman
May 30, 2012

Most of you know that there a bunch of command line options available for the Clarify Classic Client.

Some of the more common ones include:

cbtrace CBDebugger clfy waggle debug debugCB msg nocache sqlhint sqllog

 

But did you also know you can pass your own parameters and evaluate them?

Lets take a simple example

Lets start clarify, passing in a case ID number. We’ll do this by coming up with our own custom URL format.

Custom URL Format? OMGWTFBBQ!

Everyone’s familiar with URL formats such as:

http://www.dovetailsoftware.com https://twitter.com ftp://ftp.mozilla.org/

But we can also define custom URL formats, such as:

clarify://case/100

Not that it does anything, yet. But it looks cool, no?

Back to clarify.exe params

OK, so lets pass that as param to clarify.exe

From a command line, start clarify.exe with that custom URL


Gary Sherman
April 10, 2012

I’ve been doing a little Clarify Classic Client development lately, and I’ve found I’ve been using hyperlinks more and more as elements on forms as opposed to buttons.

A common usage of hyperlinks is to open URLs, such as a site’s website. But we can also use them to invoke other actions.

Here’s a form that has a few different hyperlinks in action:

case with hyperlinks

There are 4 hyperlinks in play on this form

2 Open Subcases (opens the Subcase List form, showing the list of subcases for this case) ? (Opens a message box with help text, detailing the Case Title information) Copy Case ID to Clipboard (um, copies the case id number to to the clipboard) Expand (Opens the case history


Marek Pawelczyk
March 12, 2012

There may be a need to extract all the ClearBasic code for entire project at once.

If the project consists of only a few modules, one would use CBEX tool in interactive mode, select the modules from the list, specify the destinations, and export.

But if a project involves very many modules, this method becomes burdensome – CBEX does not have a ‘select all’ capability.

One way to make one’s life easier is to use a tool developed by Dovetail Software, as explained in this article by Gary Sherman.

Another method is to generate a CBEX directive file and then use CBEX in batch mode to export all the code.

The process of generating the directive file is exactly what is burdensome in


Gary Sherman
January 11, 2012

Last year I posted about automated deployments for Clarify. From that post:

 

Doing automatic deployments of Clarify changes is pretty straightforward. If I was starting off, I would use a contemporary build script tool such as nant or rake, and simply have it call out to your schema editing tool (Dovetail SchemaEditor, or ddcomp) to perform schema changes, use an import tool (such as Dovetail ArchiveManager, or dataex) for importing forms, and then compile your Clearbasic code using CBEX, or just import it as a DAT file using Dovetail ArchiveManager. File copying, registering components, configuring web servers, and setting permissions are all common tasks that are available in these build tools as well.

 

Should you also need to do additional stuff in your database, some code that uses the Dovetail SDK can be useful.

 

You could tie


Gary Sherman
November 14, 2011

I recently had to do some modifications to the attachment form in Clarify (form 1006). This is one of those old-school forms that doesn’t always behave very well with ClearBasic. This post captures a few of my findings and learnings.

FILELIST Double-Click

 

One of the things I wanted to do was to intercept the double-click action on the FILELIST control, which happens when a user double-clicks a file to Open it.

 

Plan A: some simple Clearbasic code

Sub FILELIST_DblClick()
If FileValidation = True Then
Me.DoDefault
Else
App.MsgBox “Not authorized”
End If
End Sub

 

Looks simple right? But it doesn’t work. Even if the Me.DoDefault code isn’t ever called, the file is still opened. So if the validation failed, the user would get the message box saying “Not authorized”,  and then the


Gary Sherman
November 11, 2011

 

One of my annoyances within the Clarify Classic Client has always been the case history.

 

 

Its just one giant text blob. You have no control over the formatting. Its in chronological order. Sometimes this is OK, but typically you have to scroll to the bottom to read the most recent activity. You don’t have control over the timestamp format (DD/MM/YY vs. MM/DD/YY, as an example). The timezone of the timestamp isn’t clear. It isn’t easy to hide/remove certain entries. Its limited to 32K. etc…

 

I’ve posted in the past about the challenges of the case history, as well as how we’ve improved this within DovetailAgent.

 

In a recent discussion with a customer, their end users were complaining about the case history. Since they’re not yet ready to move to a Dovetail web app (Agent


Gary Sherman
September 27, 2011

After over a decade of doing ClearBasic coding, I’m still learning new things.

 

Today, Marek pointed out the Erl function, which returns the line number of the most recent error.

 

Within the Clarify Client, if you use the –debugCB option, you’ll get the line number of the last CB error, so it’s pretty easy there.

 

But in cbbatch, it doesn’t tell you the line number.

Error message, no line number

 

For example, I have a simple cbbatch script that I’ve coded with an error.

error

 

Notice how it tells me the error, but it doesn’t tell me *where* the error is.

 

Let caveman debugging commence. Ugh.

More error details

 

Now, lets add a simple error handler.

 

At the beginning of my routine, I add an On Error statement:

On Error


International: +1 (512) 610-5400
Toll Free: 1 (800) 684-2055