Monday, 21 September 2015

code for making bold letters for a dialogue text in ax 2012

Dialog dialog = new Dialog();
DialogText dt = dialog.addText("Test");
FormBuildStaticTextControl txtCtl = dt.control();
txtCtl.bold(7);

dialog.run();

Saturday, 19 September 2015

Code is working fine in Dev VM but in Test VM it is not working fine

Say we have developed one functionality or some customization in some so called form in dev VM and you have moved the code to test VM and you observe that  the code is not working fine as it is supposed to be.

Please go to test VM and clear the cache and refresh the table, data dictionary,

after that the code should work fine as it is supposed to be.

Tuesday, 15 September 2015

bp error - The relation under the extended data type (EDT) SalesIdBase must be migrated to a table relation. Consider using the EDT relation migration tool.

  some time we get bp error when we set the compiler level to 4 and go the compilation of code

like :

The relation under the extended data type (EDT) SalesIdBase must be migrated to a table relation. Consider using the EDT relation migration tool.


go to development AX then click on tools>>>code upgrade>> edt migration tool select the table in right hand side you will have migrate all   then in top  click on migrate single table and at last you will get message like edt has been migrated for the table.

Wednesday, 9 September 2015

Moving projects across models in ax 2012

 Moving projects across models

When moving a project from one model to another there is a particular process that must be followed:
1)    Create a new dummy project in any model

2)    Move all items from the current project into the dummy project
3)    Move the original project (now empty), into the new model
4)    Move all the items back from the dummy project into the original project
The reason for this set of rules exists due to the fact that if a project with elements in mixed models is moved to a new model, it will update all the child object to the same model.




can we  create a new project  in a new model and  move the  objects  from the  projects to newly created project.

Tuesday, 8 September 2015

look up with the all table fields of a table in ax 2012

Please refer :

 \Classes\WrkCtrBulkEditController\init          

protected void init()
{
    FormRun             callerForm;
    FormDataSource      callerFormDataSource;
    FormDataSource      baseFormDataSource;
    DictTable           dictTable;
    fieldId             currentFieldId;
    WrkCtrBulkEditField wrkCtrBulkEditField;
    int                 dataSourceCount;
    int                 dataSourceIndex;
    int                 fieldMapKey = 0;

    if( formObject && formObject.args() )
    {
        callerForm = formObject.args().caller();
    }

    if( callerForm )
    {
        baseFormDataSource = callerForm.dataSource();

        dataSourceCount = callerForm.dataSourceCount();

        for (dataSourceIndex = 1; dataSourceIndex <= dataSourceCount; ++dataSourceIndex)
        {
            callerFormDataSource = callerForm.dataSource(dataSourceIndex);

            if (!this.isInnerJoined(baseFormDataSource, callerFormDataSource))
            {
                continue; // only process inner-joined datasources
            }

            dictTable = new DictTable( callerFormDataSource.table() );

            if (dictTable && hasTableAccess(dictTable.id()))
            {

                for( currentFieldId = dictTable.fieldNext(0); currentFieldId; currentFieldId = dictTable.fieldNext(currentFieldId) )
                {
                    wrkCtrBulkEditField = WrkCtrBulkEditField::newFromDatasourceField(callerFormDataSource, dictTable.fieldObject(currentFieldId) );

                    //if( wrkCtrBulkEditField.isEditable() )
                    {
                        fieldsMap.insert( fieldMapKey, wrkCtrBulkEditField );
                        fieldMapKey++;
                    }

                }
            }
        }
    }
}

Please debug this class and find out how the look up is getting created                                                52

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...