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.

Wednesday, 14 September 2011

UK/EMEA User Group 2011

UK/EMEA User Group 2011

Holborn Bars
138-142 Holborn
London
EC1N 2NQ

15 September 2011 09:30 – 22:00

Friday, 2 September 2011

DataObject Construction

To instantiate a new DataObject use the following:

Dim newTestObject As New TestObject(Me.ProcessAppMgr, CType(NextGen.Framework.Managers.AssemblyMgr.NxAssemblyMgr.GetObjectSchema("TestObject"), Schema.ISchema))

This is the way to create new data objects on the fly without having to load them from archetypes.

Tuesday, 28 June 2011

Disabled (Greyed-Out) Fields on Forms

A field on a form can sometimes look disabled in the web browser without any apparent reason. The Access property is not set to ReadOnly and is not changed anywhere in the code.

This can occur when a change is made to an object and it becomes custom, i.e. it overrides the stock object for the first time.

A Rebuild with Dependencies on the Form will fix the problem. The field should then be enabled in the front end.

Friday, 20 May 2011

Refresh Form Attributes

Quick Tip: To refresh a Form's available attributes - the drag and drop fields/controls, simply save the form. This is useful when the underlying Object's attributes have been changed and is quicker than a close, refresh, re-open of the Form.

Thursday, 19 May 2011

No Intellisense in IDE

No Intellisense showing in the IDE code page? CTRL + SPACE not showing the helpful drop down?

Sometimes this just happens, especially when the code contains errors. Usually, a CodeDOM rebuild (CTRL + SHIFT + B), then a code parse (CTRL + R) will solve the issue.

However, this doesn't always work - even though you are well within your rights to be shown some Intellisense. In that case, try closing and reopening the object. If that gives on joy, try restarting the IDE.

After that, you're on your own.

Tuesday, 3 May 2011

Elite User Conference 2011

Elite User Conference 2011

Gaylord National
201 Waterfront Street
National Harbor, MD 20745

June 12-16, 2011

Conference Schedule

Form Labels Not Displayed/Updating

Sometimes, the text of a label on a Form is not displayed in the browser after making a change in the IDE. To force the label to update:

  • In the IDE, load the project that contains the problem form.
  • Right click the top most project node and select Build Project.
  • For Build Type, select "All AppObjects that use any AppObject in <Project Name> (Runtime Only)" and click Start Build.
  • After building, close all instances of browsers hosing 3e and open a new instance. The labels should now display correctly. 

Monday, 18 April 2011

Add Saved Objects to Collections

To display a previously saved object in an object collection, use Me.Populate(<obj_id(s)>) from within the object's Collection Code.

Tuesday, 5 April 2011

Code vs Collection Code

Applies to Objects and ReportObjects:
  • Code interacts with each item (object) in the current dataset. Methods such as BeforeUpdate() and AfterPopulate() will run for each item. The collection that contains the object is accessed via Me.ParentCollection. Use this option for changing the behaviour of on-form controls, such as Attribute read only access and value validation.
  • Collection Code runs against the whole dataset. Methods such as BeforeUpdate() and AfterPopulate() will run only once. Individual items in the collection can be access via Me.ActiveItems. Use this option when making comparisons over the whole dataset or when running finalising code after all data has been updated.
Events trigger at the item level before they trigger at the collection item. For example when saving to the database, AfterSave()will be called on the item, then on the item's collection.

Saturday, 26 March 2011

Update 3E - "Some record(s) already exist in the table NxMsg" Extract Error

In Utilities 3E, the following error may be seen in the Update 3E - Update process (part of Upgrades) when running the Apply and Repairs action:
"Some record(s) already exist in the table NxMsg for <GUID>"




To fix the problem, let the process finish then change the Source Directory by clicking Browse. Navigate to <ProjectFolder>\Logs\<ApplyFolder>\ErrorReRun e.g. \IM_CR2043_DL_CostCardTrans\Logs\2011.03.26.10.04.35Apply\ErrorReRun then re-run the Apply and Repair action.

Tuesday, 22 March 2011

Update 3E - "Could not find AppObject" Extract Error

In Utilities 3E, the following error may be seen in the Update 3E - Extract process (part of Upgrades):
"Could not find AppObject. If the AppObject does exist, verify the ID matches in the MetaXML and table. There is a Stock version, but this is a Custom extract."




This error is usually due to a stock object that is added to the Project that has no custom version, i.e. no changes have been made to it. Identify the object from the error message grid and remove it from the Project in the IDE. After saving the Project, the error should no longer appear when extracting.

Friday, 18 March 2011

Annoyance: Huge Default Report Parts

After creating a new report and giving the Root Object ID property a value, the Header, DetailsHeaderStandard, DetailStandard and Footer have their heights set to massive values. The height value of each has to be manually reduced to make it easier to work with.

Tuesday, 15 March 2011

Add Custom Methods to Processes

To use a method inside a process do the following:

1. In the Collection Code section of the Object declare an enum type to be returned by the method.

Public Enum StepResult
 Success
 Fail
End Enum

2. Still in the Collection Code of the Object, add the method as a Function with a return type of that created in step 1. Give the Function an attribute of NxProcessMethod.


<NxProcessMethodAttribute()> _
Public Function DoWork() As StepResult
 // Do some cool stuff...
 Return StepResult.Done
End Function

3. After saving the object, the method should be available to add as a step in any Process based on the object.

Validation Error: Error on Node: VM - The required attribute 'FID' is missing.

When saving a Page, following error "Validation Error: Error on Node: VM - The required attribute 'FID' is missing." indicates that at least one of the VIEWMAP nodes (PAGE->BASEOBJECTS->BASEOBJECT->VIEWS->VIEW->VIEWMAP) has no Form ID property set.

Friday, 11 March 2011

Transaction Service

One way to retrieve data from 3e is to use the GetData method of the Transaction Service.

http://shf01-3ede01/TE_3E_development/WebUI/transactionservice.asmx?op=GetData.

1. In the IDE, create a ReportObject containing the data that is needed.
2. In the IDE, create a Report based on the ReportObject. Add the columns of data that need to be exposed.
3. In the front end, load the Report and save a ReportLayout. Be sure to add any criteria and sorting needed to the associated ReportQuery.
4. To test, open the ReportQuery in the Utilities3E AppObject XML Editor. Use the XML of the ReportQuery as the parameter value of the Transaction Services GetData method.

Note that the Report and ReportQuery are just steps in the creation of the test XML. They can be deleted if they are not needed in the front end.

Wednesday, 9 March 2011

Banner Colour



To change the colour of the 3e banner change \inetpub\images\lyt-hdr-m.jpg for the horizontal repeater and \inetpub\images\lyt-dlg-logo.jpg for the 3e logo.

Update: From version 2.6 onwards, \inetpub\images\toolbar\lyt-hdr-sep.jpg also needs to be changed to get a consistent colour block across the whole banner.

ReportObjects and Templates

Changing the ReportObject that a Template is based on automatically updates the underlying XSD file after a rebuild and publish of the object. The template is saved in \Inetpub\XML\ReportObject\Schema\Read for Word and \Inetpub\XML\ReportObject\Schema\Read_Crystal for Crystal reports. The file has the same name as the ReportObject with a .XSD extension.

Selecting the Allow Reprint check box on the print pop up saves the output XML to \RenderInput.

The final report object always saves to \Inetpub\RenderOutput.