You can maybe have some problems to test some development because, the user who test this development have some Security denied access right.
You can put in Ax, your right like the user and remove your right Admin
But, what appens when you want recover your Admin right ?
- Ask to an other Admin, to give you the right
- You can change de SQL record
For the second solution, you must connect to the SQL database (throught Management Tool). Go to the database where you are (for exemple : MyCustomer_DEV) and go to the table
Find your login in the table, and change one of the right you have to “Admin”.
You maybe use, in a report, a label in a method display ?
But when you print the message, the message still in the laguage of the user !
For change this, you can have two way :
The language_id is the language of the report, but if you want, you can force a language.
Or the second, maybe more general :
You maybe know how to set the number of caracter of one String :
str 5 myString;
But if you want, for example, set this number for a lot of variable, you can do this :
str #MAX_SIZE myString;
str #MAX_SIZE mySecondString;
Have you already have the problem to insert a record a company to an other company ?
The problem is : “I can’t know if the index exist already in the other company !”
There is two methods are create from these two posts : SysDictCode and Dilip’s blog.
The first method allow you to find the primaryKey list an make a container with the fieldId.
container findPrimaryField(Common _record)
primaryKeyList = SysDictTable::getUniqueIndexFields(_record.TableId);
enumerator = primaryKeyList.getEnumerator();
primaryKey = strRem(enumerator.toString(), '');
ret += str2int(primaryKey);
The second while check the entire table, and make a check for each fieldId in the container.
And when you found a record, you return this record.
Common findRecord(Common _record1, DataAreaId _companyId)
//Look if the index of record1 exist in record2 (they must be ine different company !)
dicTableLoc = new DictTable(_record1.TableId);
record2 = dicTableLoc.makeRecord();
primaryKeysList = this.findPrimaryField(_record1);
while select record2
same = true;
for (i = 1; i <= conlen(primaryKeysList); i++)
fieldId = conpeek(primaryKeysList, i);
if (_record1.(fieldId) != record2.(fieldId))
same = false;
ret = record2;
You would retrieve the information : PrimaryKey from any Table ?
Look at this post
You want sometimes, change de properties from fields by code ? This is a exellent post over this.
Find this here
Many times Developer needs to open the table or browse while coding. Developer has to go to AOT then search for that table. To ease of this situation by following code developer can easily open the table or browse from Editor windows itself.
Source from here
As you know X++ supports methods with default values. In Ax it’s possible to detect when such a default value was used at runtime with prmIsDefault(). To see this for yourself, create a class with a method like this