Thursday, 17 July 2014

OnPageEvent Missing Handles in ServerPage

A ServerPage app object allows two framework-supported methods: the InitializeComponent Sub and the OnPageEvent sub meant for handling events raised from the web page.

When adding the OnPageEvent method via the drop-down selection at the top of the IDE page within a ServerPage code tab, the following method stub is added (for a ServerPage called MyServerPage):

Protected Sub MyServerPage_OnPageEvent(ByVal ctl As NextGen.Framework.WebUI.HtmlBuilder.BaseCtl, ByVal evtArgs As NextGen.Framework.WebUI.HtmlBuilderEventArgs)

End Sub

The template sub has the "Handles" assignment missing from the end of the method signature. Without this, the method will not get called when page events are raised. To fix this, just add the following to the end of the signature: Handles Me.OnPageEvent. The above example would then look like this:

Protected Sub MyServerPage_OnPageEvent(ByVal ctl As NextGen.Framework.WebUI.HtmlBuilder.BaseCtl, ByVal evtArgs As NextGen.Framework.WebUI.HtmlBuilderEventArgs) Handles Me.OnPageEvents

End Sub

Wednesday, 28 August 2013

External Assemblies - Referencing, Packaging and Applying Across Instances

To reference an external .net assembly in an application object:

  • First add the DLL to the \inetpub\webui\bin folder.
  • Go to the Code page of the app. object and select the References tab. 
  • Click the Add button next to References and in the popup window, scroll the tabs right and select the .net Assemblies tab.
  • Select the name of the assembly, click the Select button then click OK.
When packaging an extracted object from another instance that references an external assembly, first copy the external assembly to the \utilities\utilities3e folder. Otherwise critical errors will be reported in the Utilities3e Package step and the operation will fail.

Tuesday, 23 October 2012

BizTalk Load - Strange Behaviour with File Size

After upgrading to a new instance of BizTalk Server (2006 to 2010), strange behaviour was seen with a customised Voucher load. All of the records were imported into 3e, but certain internal 3e Object Code operations were not being performed to amend the imported data. This only happened when the imported flat file was greater than a particular size (32,218 Bytes in this case).

Following advice from this article, I changed the value of the Large Message Size in the BizTalk Group Settings from 100KB to 315KB.

This solves the problem. It seems message fragmentation caused by an insufficient message size threw errors which eventually led to the Process in 3e not executing methods further downstream.

See this msdn blog post for further information.

2.6 - Blank Fields in Report Headers

After upgrading to 3e 2.6 (from 2.5 CP12 in this case), field values in the headers of customised reports are no longer displayed. The report below is displayed with filed values in 2.5 but after upgrading, Client Name, Matter Name, Matter Number and an unlabelled Key Word field have missing values.


The issue is resolved by moving the fields into the group sections, rather than the header. In most cases this can be done without drastically altering the displayed layout:


In this case the Key Word field, Client Name, Matter Name and Matter Number have been moved into the Matter grouping section and Currency Code moved to the Currency grouping section.

This new behaviour is welcome as having grouped values in the header is bad practice. The values displayed in 2.5 headers could be any of the distinct values that are returned from the grouping. It was not usually noticed in 2.5 as the reports are normally viewed for specific Matters, Clients etc. where grouped values are the same for each returned record.

Friday, 10 August 2012

Change the Instance Web Page Title

To change 3e's web page title, change the value of the PageTitle key in the WebUI config file <func directory>\Inetpub\WebUI\Web.config.

Text and variables can be used, including:

  • [User] (displays current user name)
  • [Version] (3e instance version)
  • [WebServer] (name of the that served up the current page)
  • [Title] (name of the 3e object being displayed; Dashboard, Report, Process, etc.)
  • [DBServer] (name of the SQL server hosting the current database)
  • [DBCatalog] (name of the current database)

Examples:
<add key="PageTitle" value="3E TRIAL [Version]" />



<add key="PageTitle" value="[WebServer] [User] [Title] [DBServer] [DBCatalog] [Version]" />

Thursday, 17 May 2012

BizTalk Server and Transaction Service Config

The configuration settings file used to set up BizTalk server to 3e instance communication can be found here by default: <Program Files of BizTalk Server>\Microsoft BizTalk Server\EAI\EAI.Biztalk.Config (i.e. C:\Program Files (x86)\Microsoft BizTalk Server\EAI\EAI.Biztalk.Config).

A particularly useful value is contained in the <Cobra> node. This holds the transaction service URL that BizTalk uses to integrate with the 3e instance. Connection credentials are also stored here.

...
<Cobra>
 <WebServiceUri location="http://TE_3E_SERVER/TE_3E_INSTANCE/WebUI/TransactionService.asmx" />
 <DefaultUser userName="BizTalkUser" password="*encrypted password*" domain="NetworkDomain" />
</Cobra>
...

Friday, 16 March 2012

Dashboard Edits Not Saving

When editing a dashboard, for changes to save correctly the WebUI site must have a config WorkingMode value set to "Production" (rather than "AppDevelopment").

Otherwise after saving a dashboard the page refreshes to its previous state and any edits are lost.

To change the setting, open the config file: [INSTANCE_DIRECTORY]\Inetpub\WebUI\Web.config and change
<add key="WorkingMode" value="AppDevelopment" />
to
<add key="WorkingMode" value="Production" />.

Thursday, 8 March 2012

Current Instance URL

To return the URL of the currently running instance, from a code page use:

Me.ConfigMgr.GetApplicationURLBase()

Returning, for example: http://server01/instance01/webui

Tuesday, 7 February 2012

Project Rename Produces Duplicate

In the IDE, right clicking on the Project node in the Project pane gives an option to "Rename Project ID".
Renaming a Project in the 3e IDE
On the face of it, renaming the Project seems to work as expected. However, if the IDE is refreshed (or closed and reopened), both a Project with the old name and a Project with the new name now exist. This can be seen by pressing the Open... button at the top of the Project pane.

To workaround this, best practice when renaming Projects would be to:
  1. Rename the Project.
  2. Save the Project.
  3. Refresh the IDE (Refresh button next to Logout).
  4. Open the Project with the old name.
  5. Delete the Project with the old name.
  6. Open the Project with the new name.
This avoids a build up of unnecessary, renamed Projects.

Friday, 3 February 2012

Exception Raising

The standard method of raising exceptions in 3e is to display them in the top Exception panel - the panel shared with other item lists such as the Worklist.
Exception raised in Proforma Generation Process
To raise an exception in this way, the Exception property of the Process's underlying Object must be set to an instance of the NxApplicationException class. For example, from within the Object:
Me.Exception = New NxApplicationException(New Guid("430e4f35-2834-46ea-b031-b718054c7f62"))

Or from a Process:
Me.ProfMaster.ProformaCollection(0).Exception = New NxApplicationException(New Guid("430e4f35-2834-46ea-b031-b718054c7f62"))

The GUID value is set to the Id of a Message that describes the error.
To remove the Exception, set the Exception property to null:
Me.Exception = Nothing

Thursday, 5 January 2012

BillSum Table Rebuild

The BillSum table is a snapshot of all billing information per Timekeeper and Matter. It is effectively a non-live amalgamation of the Timecard, Costcard and Chargecard tables. It is updated periodically but can become out of date and inaccurate due to various errors in the system.

To rebuild the BillSum table take the following steps, courtesy of Weronika Kozlowska, Application Support Consultant at Elite Thomson Reuters UK:

1. Go to Notification task Manager > select the BillsumMsgQueue task > tick the 'Disable' option and release
2. Go to the Build Billsum Tables process > tick all 4 month / period options > Background > Release
3. After a while, go to Notification Task and Log viewer and click the 'View Background Tasks' button you will see your process initally with a 'Running' status > periodically check whether the status changes to 'Complete' (It might take a few hours)
4. Once the task is complete, go back to Notification task Manager > select the BillsumMsgQueue task un-tick the 'Disable' option and release.

If you have a period of the day/week when no billing information (time, costs, charges) is ever captured, late at night or early morning for example, the Build Billsum Tables can be scheduled to run automatically via the Notification Task Manager process. The BillsumMsgQueue task need not be disabled first if you are confident no billing information will be captured during the run time. Note that the Build Billsum Tables task can take several hours to run.

Thursday, 8 December 2011

Right-Click Cancel on Processes

Right-clicking on a Process in My Action List shows a handy Cancel pop up menu. Using this short cut can be much quicker than opening the Process and then cancelling from within a new page.
Cancel a Process from the Action List

For a right-click cancel to work, the Process must contain a path that leads to an end point without intervening steps.

Right-click cancel possible - A Process with a route to an end point with no steps (the bottom "Cancel" route)

Right-click cancel not possible - A process without a "no-step" route to a end point 

When a Process does not contain a route without intermediate steps, an error is show when attempting to cancel from the Action List.

Error message from a failed right-click Process cancel
However, intermediate steps are sometimes required when cancelling a Processes to perform certain tasks or return to a previous state. Unlocking records or freeing up resources for example. Rather than adding a step and preventing a right-click Action List cancel, the code that would be in the step can be written in the Else rule before the end point.

The Else rule (selected in blue) before the end step

This way, clean-up functionality can still run when the user cancels from the Action List.

Tuesday, 6 December 2011

Process Else Rules - Accessing the DataObject in Code

Within the Code tab of a Process, the Base Object can be accessed as a property. For example, the evaluation of CUSTOM rules can sometimes require a decision to be made based on a value contained within the Base Object.
Access to the ProfMaster Base Object from a custom rule in Process code
Function Evaluate As System.Boolean
Return Me.IM_AutoBillEdit.IsOutsideProcess.Value(False)
End Function

However, this Base Object property is not accessible in Else rules. To access it, cast Me.Process to its type and then access individual objects though the object collection.
Access to the ProfMaster Base Object from an ELSE rule in Process code
Public Overrides Sub OnRule()
For Each profMasterItem As ProfMaster In _
CType(Me.Process, NextGen.Application.Process.ProfProcess). _
ProfMasterCollection

NextMessage = profMasterItem.Description
Next
End Sub

Wednesday, 9 November 2011

Transaction Service - GetArchetypeData

In a previous post, the GetData method of the Transaction Service was explained. An altogether more useful method is the GetArchetypeData method, taking any well-formed XOQL query and returning a dataset.

The input parameter must be encapsulated in a QUERY node (note the caps) in the namespace "http://elite.com/schemas/query".

Example:
<QUERY xmlns="http://elite.com/schemas/query">
[XOQL statement]
</QUERY>

An XOQL statement can be obtained from Utility3e's OQL Analyser by creating the query in OQL first, executing it and then copying the contents contained in the XOQL tab.

Friday, 4 November 2011

Time Out During Upgrade - Toggle READ_COMMITTED_SNAPSHOT Failed

Utilities 3e can sometimes fail when running the Upgrade process and throws a time out error. The Upgrade process then hangs and doesn't respond to the stop command/button. The only way out is to close the whole Utilities app.

The error message has a comment of "Toggle READ_COMMITTED_SNAPSHOT Failed" with extra info along the lines of "Error executing System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

The reason for this is the database has its READ_COMMITTED_SNAPSHOT setting turned OFF before upgrading and does not turn it back ON before failing. Utilities 3e fails to function correctly, as does the IDE and the front end!

The database can become inaccessible in Sql Query Analyser / SSMS, preventing queries being ran against it. Taking the database offline then bringing it back online solves this problem.

What's required is to turn READ_COMMIT_SNAPSHOT back on. This is typically done by running this on the DB in question:

ALTER DATABASE <DATABASE_NAME> SET READ_COMMITTED_SNAPSHOT ON

However, this statement can fail to run correctly and endlessly run in Query Analyser, never completing. A better option (for Sql Server 2005 - i.e. 3e 2.5 and below) is:

IF(CHARINDEX('Microsoft SQL Server 2005',@@VERSION) > 0)
BEGIN
    DECLARE @sql VARCHAR(8000)
    SELECT @sql = '
    ALTER DATABASE ' + DB_NAME() + ' SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    ALTER DATABASE ' + DB_NAME() + ' SET READ_COMMITTED_SNAPSHOT ON;
    ALTER DATABASE ' + DB_NAME() + ' SET MULTI_USER;'
    EXEC(@sql)
END

An IIS Reset may be needed after this, but after that all 3e systems should be running as before. The Update from within Utilities3e always seems to work the second time around.

Wednesday, 26 October 2011

Adding New Bank Accounts

If a new Bank Account is needed, other dependencies may need to be created first. The order in which to add these dependencies is as follows:

  • Bank Group
  • Unit (if a new unit is requried)
  • GL Unit (if a new unit is requried)
  • GL Natural
  • GL Account
  • Bank Account (Either Bank Account Client Account or Bank Account AP (Office))

Wednesday, 5 October 2011

Spell Check

Spell check can be called natively on a Narrative type Attribute. In the Object, call Me.<AttributeName>.SpellCheck(), a pop-up window appears if any spelling mistakes are found.

Spell check can also be called on a Card Object by casting to an ICard type and calling RunSpellCheck().

Monday, 19 September 2011

Launching Dashboards or Report Layouts with Parameters

Method: Pass the parameters in the URL.

Step 1: Parameter Object
The parameter object attached to the Dashboard or Report Layout must be able to interpret the URL. This can be done in the AfterAdd handler method.

Example:

Protected Overrides Sub AfterAdd()
Dim strMatterIndex As System.String

' call stock object after add code
MyBase.AfterAdd()

' get matter number from url
strMatterIndex = System.Web.HttpContext.Current.Request.Item("MatterIndex")

' if there is a matter index
If Not String.IsNullOrEmpty(strMatterIndex)

' set matter index parameter
Me.Matter.Value = CInt(strMatterIndex)

' auto submit parameters
CType(Me, IParamObject).IsAutoSubmitParamObject = True
Else
' don't auto submit parameters
CType(Me, IParamObject).IsAutoSubmitParamObject = False
End If
End Sub


Step 2: Launching Object
Create a URL Action on the launching Object and implement the Execute function.
Return the URL for the Dashboard or Report Layout with the required parameters appended.

Example:

Protected Overrides Function Execute() As System.String
If Me.Owner.Matter.IsNull Then
Return Nothing
Else
Return String.Format("{0}&SID={1}&MatterIndex={2}", _
Me.UrlMgr.GetDashboardUrl("IM_ENQUIRY_MATTER"), _
Me.UserMgr.SessionID, Me.Owner.Matter.Value)
End If
End Function


Step 3: Action
Add the URL Action to a UI element.

Friday, 16 September 2011

Circular Dependency

Circular dependency in objects is not checked for on the save or build of individual files.

However, errors can arise when trying to:

  • Using 'Build Project' from the context menu of a project in IDE.
  • Using 'Update 3E - Extract' in the Upgrades section of Utilities 3E.

If both of these processes fail, chances are that a circular dependency exists in at least one of the project's objects.

To find the culprit, build each object individually with a Build Type of 'All AppObjects that use <Obj_Name> (Runtime Only)'. A circular dependency exception will show in the build output of the problem object.