How to get formatters of acumatica with reflector

During reading manual of acumatica for T100 test I faced control PXMaskEdit. That is wonderful control because it allows you to make masked input. I was very happy, but was unable to realize how to customize characters for entering values. Search in pdf file didn't give me satisfactory results so I decided to decipher masking fields with help of google, and wasn't successfull with search results. So I made next step and used my favorite tool reflector. 

In the window of reflector I typed segmentmask and below you can see screenshot of what I found:

 

Little bit of scrolling opened in front of my eyes the following picture:

                            case '9':

                                item.EditMask = MaskType.Numeric;

                                break;

                            case '?':

                                item.EditMask = MaskType.Alpha;

                                break;

                            case 'C':

                                item.EditMask = MaskType.Ascii;

                                break;

                            case 'a':

                                item.EditMask = MaskType.AlphaNumeric;

                                break;

And this brought me to the following conclusions:

a. If you want in some particular place to be inputs of numbers you can use 9. For example (999)-(999)-99-99 will give you the following input mask: (___)-(___)-__-__

b. I assume that "?" could stand for alphabetic that matches only a-z, not symbols like: > !@#$%/[]{}(), etc.

c. C or Ascii symbols. I think it's understandable for what it stands for :)

d. a or Alpha numeric. I think it stands for symbols a-z and numbers 0-9.

 

 

 

MS SQL find table by data record

Some time it happens that you need to find some string in the MS SQL database. 

Here I found very helpful ms sql code which helps to find any string in database.

At stackoverflow I found optimization of that script, which I copy/pasted below:

 

CREATE PROC SearchAllTables
(
    @SearchStr nvarchar(100)
)
AS
BEGIN

-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
-- Purpose: To search all columns of all tables for a given search string
-- Written by: Narayana Vyas Kondreddi
-- Site: http://vyaskn.tripod.com
-- Tested on: SQL Server 7.0 and SQL Server 2000
-- Date modified: 28th July 2002 22:50 GMT

DECLARE @Results TABLE(ColumnName nvarchar(370), ColumnValue nvarchar(3630))

SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET  @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')

WHILE @TableName IS NOT NULL
BEGIN
    SET @ColumnName = ''
    SET @TableName = 
    (
        SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
        FROM    INFORMATION_SCHEMA.TABLES
        WHERE       TABLE_TYPE = 'BASE TABLE'
            AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
            AND OBJECTPROPERTY(
                    OBJECT_ID(
                        QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
                         ), 'IsMSShipped'
                           ) = 0
    )

    WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
    BEGIN
        SET @ColumnName =
        (
            SELECT MIN(QUOTENAME(COLUMN_NAME))
            FROM    INFORMATION_SCHEMA.COLUMNS
            WHERE       TABLE_SCHEMA    = PARSENAME(@TableName, 2)
                AND TABLE_NAME  = PARSENAME(@TableName, 1)
                AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
                AND QUOTENAME(COLUMN_NAME) > @ColumnName
        )

        IF @ColumnName IS NOT NULL
        BEGIN
            INSERT INTO @Results
            EXEC
            (
                'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630) 
                FROM ' + @TableName + ' (NOLOCK) ' +
                ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
            )
        END
    END 
END

SELECT ColumnName, ColumnValue FROM @Results
END

Find screen

In case if you look at something in acumatica and want quickly to find sources of that window in resharper you can do the following:

1. click in the command line, and you'll see something like this:

just withoug red rectangle.

2. Switch to your Visual studio and navigate to page gl201000.aspx or gl201000.aspx.cs. In case if you have resharper in your Visual Studio you can navigate to file in a window like this:

Acumatica

Here is just to anounce that the first post in my blog will be about acumatica. If to speak in general acumatica is ERP which from programmers viewpoint is like CMS which is intended for management of the resources at company. It is much cheaper then SAP and it also tries to become competitor of AXAPTA. So, lets see what will be the outcome.