How to create technical document in dynamics ax

Description:-

Creating detail technical document in projects is very time consuming. Particularly if there are many objects in the project it will take more time in creating it.Here is the solution.This job will list the table fields properties like table field name, help text(Description),type, Size etc.

static TehnicalDocument(Args _args)
{   
COM         document;   
COM         wordDocument;   
COM         wordRange;   
COM         app;   
str         tableContent;   
SysDictTable    dictTable;   
SysDictField    dictField;   
Counter         fieldCounter;   
Counter         arrayCounter;   
strtypeofTheField(DictFielddf, Types _types)   
{       
strtypeName;       
SysDictTypedictType;       
SysDictEnumdictEnum;       
;       
switch(_types)       
{
            case Types::UserType    :  dictType = new SysDictType(dictField.typeId());
                                        returndictType.name();
            case Types::Container   :  return container; 
            case Types::Date        :  return  date; 
            case Types::Enum        :  dictEnum = new SysDictEnum(dictField.enumId());
                                        if(dictEnum)                                           
return dictEnum.name();
            case Types::Integer     :      
                                 return  int;
             case Types::Int64       :                                       
return  int64;
             case Types::Real        :                                       
return  real;
             case Types::Record      :                                       
return  record;
            case Types::VarString   :
            case Types::RString     :
            case Types::String      :  
return  str;
            case Types::BLOB        :  
return  blob;
            case Types::DateTime    : 
return  datetime ;
            case Types::Guid        : 
return  guid ;
            default : return ;       
}   
}   
;   
app = new com("Word.Application");   
app.visible(true);   
document     = app.Documents();   
wordDocument = document.add();   
wordDocument.activate();   
wordRange   =wordDocument.range(0,0);   
dictTable = new SysDictTable(tablenum(CustTable)); // Mention your table here   
for (fieldCounter = 1; fieldCounter<= dictTable.fieldCnt();
fieldCounter++)   
{       
dictField = new SysDictField(dictTable.id(),
dictTable.fieldCnt2Id(fieldCounter));        
if (!dictField.isSystem())       
{
            for (arrayCounter = 1; arrayCounter<= dictField.arraySize(); arrayCounter++)
            {
                dictField = newSysDictField(dictTable.id(), dictTable.fieldCnt2Id(fieldCounter),
arrayCounter);
                 tableContent +=dictField.name() + "\t" + dictField.help() + "\t" +
typeofTheField(dictField, dictField.type()) + "\t" +int2str(dictField.stringLen()) + "\n";
            }       
}   
}   
wordRange.insertAfter(strfmt(tableContent));       
wordRange.convertToTable();
}

Note:- This has been developed as per my requirements. Beautification and customization can be done as per your requirements. I wrote simple job to do this. But it can be customized in such a way that you can right click the project- context-menu- create technical document and will create the technical document for all the objects(Enums,EDT,Forms,classes etc) in the project.

Related Posts

Previous
Next Post »

Thanks for comments.....