Reporting service is broken

This morning when I walked through the office doors, everybody stormed to me, screaming that they can not generate reports. No reports could be generated indeed.
I’ve checked if all the HR.Net services were running on application server. And could not spot the difference. Checking the log did show me that there was an error when Reporting service did restart during the night.
Error looked like this:
Failed to stop service. System.Exception: Couldn't kill the workers
Question now what workers did it try to kill and how did they defend themselves? -))

Last time I have seen this error message about a week ago. That time my boss did have a go on this problem and he resolved it by restarting SQL Server services. I did the same and it worked, but I have a suspicion that only SQL Server Reporting service needs to be restarted. So if you run into the same problem, try restarting only Reporting Service and if it does not work, go for the entire SQL Server.

Posted in Uncategorized | 3 Comments

External events vs HR.Net

We are using older version of HR.Net and did not upgrade to the latest version just yet. So for those who use the fresh version this article will not be very useful, as I believe this is implemented as a standard tool of HR.Net.
For people who are stuck with older version (like us) this will be handy, so keep reading.

On many occasions we were in position where after some event in HR.Net we need to do something out of control of HR.Net. One of examples is creating domain user for new employee: when new employee is hired we wanted a new domain account created automatically. Our version of HR.Net can not do this.

For this exact reason we are using a “trigger” trick: you can set HR.Net trigger on any event inside of the system. So on inserting into PEOPLE table we can have trigger that writes in EXTERNALEVENTS table. This table has standard set of columns plus our parameter-columns (legend, key1, key2, date1, date2, etc).

In SQL Server we have a trigger sitting and listening for everything happening to EXTERNALEVENTS table. And on insert into this table, this table fires off its own logic. For example if a record with legend “New AD-User” goes into this table, trigger know that it needs to launch VisualBasic script that creates a new domain user.

That is just an idea for the technique. I’m not going to go into detailed explanations, this might take very long time to explain. But if you are interested in this, please let me know in comments – I’ll get more details on the pages.

Posted in Uncategorized | 3 Comments

HR.Net Workflow Service is not starting

Once I came across the problem when HR.Net Workflow Service was stopped and did not want to start.
The error message I was getting on the attempt to start the service looked like this:
Workflow Service Startap Error

When I checked the Event Log, there were several errors corresponding to that workflow. The error message said:
Service cannot be started. Common.CustomExceptions.EJ_Security_AccountSuspended: Your account has been suspended. Please contact your system administrator.

The Workflow service uses HR.Net user account to gain access to the system. This message means that user is suspended or password not correct in the configuration file.

Open up Workflow Service.exe.config file in (usually located in C:\Program Files\OneClickHR Plc\HRnet Application Server), scroll to the end of the file, find block called EngineData. And find the information about user account that Workflow Service uses. There might be more than one block (one for production, another for development database) and check that all the users there are showing correct information (right username, correct password).
Check if you can login into all the databases with that credentials. Most likely that the one of the users is suspended or had the password changed.

For my case, in production everything was fine, but development system had administrator account suspended for some reason. Un-suspending the account in dev did help with the problem.

Posted in Uncategorized | Leave a comment

Getting full HTML source of HR.Net form/workflow

HR.Net is working through web-browser and in the background it is plain html pages with javascript.
In the latest versions of HR.Net we have ability to put in our JavaScript into screens and workflows. And sometimes it is useful to see what HTML code is actually on the page.
To output HTML source code do the following: on the required screen place a field of type Memo. Give it a proper name. Then open Custom Script dialog for that screen an put there the following code:

$HRnet("MEMO FIELD NAME").setDisplayValue(document.body.innerHTML);

Replace “MEMO FIELD NAME” with the name of the memo field you have created.
Next time you open this screen, you will have the entire html source of the page loaded, where you can review the structure and develop further JavaScript. This technique allowed me to do much more stuff on the screen and enhanced interaction with a user.

Enjoy.

p.s. as Vicas says you can also do this:

var popup=window.open();
popup.document.open("text/plain").
               write(document.documentElement.innerHTML)

or

var popup=window.open();
popup.document.open("text/plain").
               write(document.documentElement.outerHTML)
Posted in Uncategorized | Tagged | 6 Comments

Picklist search

Sometimes it is handy to have a deeper look on the HR.Net Picklists.

Picklists are set values of text data. Opposing to plain text fields, picklists can have only set number of values and can not be easily changed by end user. On user interface picklists can be presented as a drop-down menu or as a separate window. I prefer to have picklists to be as a select menus – this is more user friendly, but if the picklist has many options, better have it as a separate window.

Today, one of my tasks was to merge one picklist with the other one: Picklist A and picklist B, A had few options that are not in B. So I had to find all missing options and add them to B, then depricate A.

First I tried to use inbuilt tool to compare picklists, but that was not easy and I got lost easily (there were too many options to keep track off). So I made up a little sql script to find all the options belonging to one picklist.

DECLARE @txt varchar(50);
SET @txt= '%'+RTRIM('Picklist Name') + '%'; -- Put Picklist name here
select lang.shortdescription  as [Picklist name], val.Storevalue as [Store Value], val.displayvalue as [Display Value]
from OC_PicklistValues val
	inner join OC_PICKLISTLANGUAGES lang on lang.picklistid=val.picklistid
where lang.shortdescription like @txt

This would give you a list of stored values and display values of the required picklist.
Then you can save the resulting set into Excel, have another picklist info displayed and saved into Excel again.. and having 2 picklists together on one page it is easy to identify what changes are required to the resulting set.

Posted in Admin Console, SQL Server | Tagged , , | Leave a comment

Recording Absence

Last week a user complained to me that she can not record an absence that is longer than 2 years. I checked myself and indeed I can’t record this – with no error message the end date of absence is rolled back to 2 year mark.

A question was raised with Vizual HR.Net support team and their answer was:
change settings in files *.config.

<key xsi:type="xsd:string">MaxAbsenceSpanInDays</key>
<value xsi:type="xsd:string">731</value>

This lines do limit absence length allowed. So if you find this settings in Hrnet\Web.config file, Workflow Service.exe.config file and Scheduled Plugin.exe.conf, you can change them. Make sure you have the same values in all the files.

Be careful when changing Web.conf file, as any changes to this file will logout all the currently logged in users. Also don’t forget to restart Worflow and Plugin services on your web-server.

Posted in Uncategorized | Tagged , , | Leave a comment

Develpment environment and emails

Recently I’ve discovered that our development installation of HR.Net is living it’s own life and sends out of date emails to staff, confusing them big time.

To stop this happening I made a little research inside of the system HR.Net tables and discovered that OC_USERS does contain all the users information including their emails. This matter is simply resolved. Inside of sql server query manager type in this:

use hrnetdev;
update oc_users set email='HRNETDEV_'+email
where email is not null

This renders all the user emails as unreachable.

After that I’ve discovered that workflow mailers do have typed in emails like like ‘recruitment@domain.com’ and this will go through when a workflow is started in dev. For this I found table called OC_WORKFLOWSTAGEPARAMETERS. In there Vizual stores all the kinds of parameters for workflow stages. There is a type of parameter called ‘Recipient’. If you select all of those, you’ll see the typed emails. And if you see them, you can change them:

use hrnetdev;
update OC_WORKFLOWSTAGEPARAMETERS
SET data=cast( ( 'HRNETDEV_'+ cast(data as varchar) ) as ntext)
where parametername='RECIPIENT' and data like '%@%'

This way we isolate development environment from the real world -))

Posted in Uncategorized | Tagged , | Leave a comment

How to generate random string in HR.Net

One of the projects I’m doing now is connecting HR.Net system with our Active Directory. Every time new employee start, we want to create a new user in AD and inform the manager about new account with the password.

So we have a table that stores usernames, passwords and other relevant information. To generate username we just take furst name and lastname, combine them together. Problem here would be with the password: we want to have it random for every new user. But HR.Net can not generate random strings.

What I thought might be a solution here: create a new computed field of type text, take primary key of this table and convert it into text, take first 6 characters from guid-string.

Don’t forget you are working with HR.Net from Vizual.. and nothing is simple there. Computed field did not work as required.

Here is the SQL I want to have as a computation: SUBSTRING( CONVERT( VARCHAR(36), people_id ), 0,6 ), having people_id as guid lookup to People table. But for some reason stupid validation mechanism inĀ  HR.Net did not let me do this – it did not allow me to have fields of type guid to be present in computation sql. WHY??? why the hell not have guid in computation?? VIZUAL? why not? please reveal this world-class secret..

Anyway, instead of people_id I’ve put in newid() function, so in HRNET it looks like this: SUBSTRING( CONVERT( VARCHAR(36), NEWID() ), 0,6 ). Then I went to backend SQL Server and changed the properties of this computed field – changed the function to what I require and saved it.

In HR.Net computation string still remains the same – probably it is saved somewhere else, but actual computation takes place in SQL Server.

Everybody is happy now.. apart from Vizual developers who had to implement this silly validation.

Posted in Uncategorized | 2 Comments

The SQL Server Broker for the current database is not enabled.

During the update of our HR.Net system to version 3.0 we also moved from SQL Server 2000 to SQL Server 2005. And this involved loads of changes in setup.

We had our production environment working fine from the day zero, but there were loads of problems with development system.

Finally we managed to resolve almost everything for development and there was a point that we though is is all working fine.. but the last error came up:

“The SQL Server Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.”

Tried to enable SQL Broker in SQL server, but not managed, so asked Vizual a question. In their reply they supplied sql script to run in sql-server: Enable Service Broker SQL

Change variable @DBNAME to name of your database and execute this script. That exercise did sort out my problem.

Posted in Uncategorized | Leave a comment

Change Mailed from in Mailers

Sometimes you need to change the way emails from workflows going to folks look like.

Today I needed to change “Sent from” filed and that was quite an effort.

I needed to go to installation of the HR.Net Application Server (standard folder is C:\Program Files\OneClickHR plc\HR.net Application Server\) and find file Workflow Service.exe.config

In this file you find sections called WorkflowSenderEmail and SenderName. Change this to what is required.

Try mailer again.. and nothing changed! Because we need to restart Workflow service to get changes into the system. Go to list of services on your server and restart “HR.net Workflow Service“. Then check the mailer and BINGO! The names are changed.

Posted in Uncategorized | Tagged , | Leave a comment