Table of contents

Introduction

Development Environment

Web Development and Improvements in user experience

(Productivity and Enterprise-level Application Development Features)

Ajax Overview, [[21759|GeneXus' target='_blank'>Ajax' target='_blank'>Ajax Overview, [[21759|GeneXus and Ajax]]

Business Components

Business Component - Publication as an Enterprise Java Bean

Practical course: Bluesky Charters
 

Application Localization

Application Localization
Demo
Translation Tool
Help "in any language"
Practical course: Bluesky Charters
 

Patterns

About this topic
Patterns based development
Description
Built in Patterns
Work With Pattern
Demo: Work With Pattern
Practical course: Patterns
 

Better data model

Null handling optimizes navigations
Nulls property

 

User experience

New options on rightclick in win
 

Reverse Engineering

Database Reverse Engineering Tool
 

New Platforms

MySQL
.Net Mobile Generator
More J2EE support than ever
 

Data Types and Methods

Message Queue handling data types

DirectoryDataType
LDAP Data Type

URL access Property
New IIF function
New byte count function
New Methods for attributes, variables and enumerated domains!
XSLTApply Method
Procedures can now call web objects
Web Services: Grouping Locations
News about model, object, and control properties


Unofficial Content
  • This documentation is valid for:

New Methods

Scope

Languages: All
Objects: Procedures, Transactions, Work Panles, Web Panels
DBMS:All



Introduction

Given the method notation (<attribute>.<method>) is more 'developer friendly' than the function one (<function>(<attribute>) ), a set of new methods associated with attributes and variables were introduced.
 

Description

Conversion Methods

Any attribute or variable have now a set of built in methods for string conversions.
 

  • ToString(): Converts the value to a string. This methods avoids the need to remember which is the conversion to string function for each type, for example instead of using DTOC(&Date) use just &Date.ToString().
  • FromString(): Set the attribute or variable value from a string.

&CharacterVariable = InvoiceDate.ToString()

InvoiceDate.FromString(&CharacterVariable)



Null and Old Methods

The Null and Old functions can now be used as methods:
 

New Method Available Function
IsEmpty Null
SetEmpty NullValue
IsNull IsNull
SetNull NullValue
GetOldValue Old


// Use:
error('Invalid date') if InvoiceDate.IsEmpty()
...
// instead of
error('Invalid date') if null(InvoiceDate)



Considerations

At the Cliente Side if an attribute is null both methods (IsNull and IsEmpty) return true. In most situations GeneXus handles nulls for attributes correctly.

At the Server side only one (or none) method evaluates to true. If the attribute is null then only IsNull will be true and if it's empty, only IsEmpty returns true.

The following are a few code examples of the above statements:

Example 1: Server side evaluation

For each
Where attribute.IsEmpty()        // server side execution
	// Only Empty attributes
EndFor	


In this case the condition is evaluated by the server side so only empty' values are retrieved.

Example 2: Client side evaluation

For Each
	If attribute.IsEmpty() // client side execution
		// Empty and Null attributes
	EndIf
EndFor


This code is evaluated at the client side. Both null and empty values are retrieved.

There are some exceptions of this rule where GeneXus knows whether the attribute is Null or Empty in the client side:

For Each
	If attribute.IsNull() // client side execution
		// Null attributes
	EndIf
EndFor


In this case only "Null" atributes will be retrieved. But if the condition is in another context, for example inside a subroutine, the condition will evaluate to True whenever the atribute is empty or null:
 

For Each attribute      
     Do 'Sub1'
EndFor

Sub 'Sub1'
      If attribute.IsNull() // client side execution
		// Empty and Null attributes
      EndIf
EndSub


Enumerated Domains

  • Convert(<expression>): convert the <expression> in a valid enumerated value.

Att_based_on_an_enumerated_domain = Domain.Convert(15) //when 15 is a value available in the domain


Related Information

New Methods for already existing functions
RoundToEven Function and Method

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant