Name is Anant Dubey and the intent to create this blog is to discuss the problems and issues that developer face in the dynamics AX development and to share the new things that come up with the new version of AX.

Monday, 14 November 2016

Full text index in AX 2012

Consider following points for Full text index on Dynamics Ax 2012
  • Full text index used only on text fields on table.
  • They find all records from table which contains the key words
  • Queries can be used to and full text index used in range filters
  • If keywords contains spaces then it will used as “Or” operator.
  • X++ select statement cannot use full text index.

Let explore the full text index on our custom table “HSPatientTable”
And we want full index search of FName of above mentioned table. First of all right click on table and from property window set table group property to “Main”.
Now expand the full text Index node of table and create a new full index name it as IdxFName and drag drop the Fname in this index.
Compile and synchronize table so changes reflect at sql server level.

Now create Now Ax job and paste following code there
static void Job1(Args _args)


HsPatientTable patientTable;

Query query;

QueryBuildDataSource queryBDSource;

QueryBuildRange queryBRange;

QueryRun queryRun; 

delete_from patientTable;

patientTable.HsPatientId ="01";

patientTable.FName =" Ali Raza zaidi";


patientTable.HsPatientId ="02";

patientTable.FName =" Ranjah jogi";


patientTable.HsPatientId ="03";

patientTable.FName ="Waseem akahram";


patientTable.HsPatientId ="04";

patientTable.FName ="Shah jii";


patientTable.HsPatientId ="05";

patientTable.FName ="AX guru";


query = new Query();

queryBDSource = query.addDataSource(tableNum(HsPatientTable));

queryBRange = queryBDSource.addRange(fieldNum(HsPatientTable, FName));




// The space character is treated as a Boolean OR.

queryBRange.value("AX jii");



queryRun = new QueryRun(query);

while (


patientTable = queryRun.get(tableNum(HsPatientTable));

info (" Patient Id: "  + patientTable.HsPatientId + " , Patient Name: " +patientTable.FName);



I used the value “AX jii”. The space between two words consider as Or and in result it will return two records

Reference taken by:-

1 comment:

  1. Messenger İndir
    Messenger, Facebook messenger indir ile birlikte çalışan ve isterseniz Facebook’a girmeden messenger yükle mesaj yollayabileceğiniz uygulamadır.