Skip to main content

Infolog in MSD axapta

Infolog

The Infolog is used to communicate with the application users. You use the Infolog to inform the user of validations, if an error occurs, or to display information to the user while processing a job. The Infolog is opened in a separate window, and opens automatically when called by a program. Information in the Infolog is removed when the Infolog window is closed, so if you need the information for later use, you can print
the contents of the Infolog window by using the print menu item in the top menu.

Information in the Infolog can be triggered both from code and by the kernel. Kernel information typically involves system integrity issues, such as information about mandatory database fields. From X++ you can control the information in the Infolog.

There are three types of information in the Infolog. The types, which may be identified by the associated icon include: info , warning and error . Info text is generally displayed to inform the user about actions being performed by the system. Warnings and errors typically represent issues that may require action from the user, and may indicate that a process is unable to proceed. If a help page or an action is attached to the
information put in the Infolog, the icons will have a mark indicating the extra information.


 static void Intro_Infolog(Args _args)  
 {  
 int i;  
 ;  
 info("This is an info.");  
 warning("This is a warning.");  
 error("This is an error.");  
 setprefix("prefix text");  
 for (i=1; i<=3; i++)  
 {  
 setprefix("1. for loop");  
 info("loop 1");  
 }  
 for (i=1; i<=3; i++)  
 {  
 setprefix("2. for loop");  
 info("loop 2");  
 }  
 info("Check customer parameters.", "",  
 SysInfoAction_Formrun::newFormname(formStr(CustParameters),  
 identifierStr(Customer_defaultCust), ""));  
 info("Check the sales form help page.", "ApplDoc://Forms/SalesTable");  
 throw error("This error stop execution.", "");  
 }  
This is an example on how to use the Infolog from X++. The first three lines show how to add a simple info, warning and error information. When using warning() and error() information you will normally use the throw command as shown in the last line of the example, as the throw will stop any further action like updating a record.

If you are adding a lot of information to the Infolog, you can use the setprefix() function to organize the information and make the presentation more user friendly. The above example shows how you can structure a pair of nested loops so as to separately group the content in the Infolog. The prefix for the first Infolog entry represents the outer with separate indented prefixes created for each of the two loops that display info messages.

An entry in the Infolog takes three parameters. The last two parameters are options used for linking to a field in a form, or linking to a help page in the online help. The two last info() lines show how to use the optional parameters. The first links the Infolog entry to the customer parameter form. The system will display this form if the user double clicks on the message in the Infolog. The last info() entry links the Infolog entry to the sales
form’s help page. Notice the optional parameters are always used one at the time as you
cannot link to both a form and the help system. Using links in the Infolog is a userfriendly way of communicating with the user; when an error occurs. You can provide the user with information on where exactly to go to fix the problem or provide the user with additional help on how to resolve the error. Unfortunately, changes to these links do not propagate, so if a referenced form field name or help page is changed, you will have to manually maintain any associated links.

The Infolog has a size limit of 10,000 entries. The Infolog should not be used for reporting detailed status messages representing the normal activity of batch programs. You can programmatically change the infolog’s maximum size, but keep in mind that the Infolog is not meant to handle large amounts of data. Building an Infolog with several thousand entries takes time and processing resources

Popular posts from this blog

strScan and Find a first occurrence of a string in a string using x++

strScan (Find a first occurrence of a string in a string) info("int strScan(str _text1,str _text2,int _position,int _number)"); info("Searches a text string for the occurrence of another string."); info("_text1 - The text string to search."); info("_text2 - The string to find."); info("_position - The position at which the search should start."); info("_number - The number of characters that should be searched."); info(int2str(strScan("ABCDEFGHIJ","DE",1,10)));

Code to get customer Primary Address in Ax 2012

Below Code to get customer Primary Address in Ax 2012. CustTable custTable_P; DirPartyTable dirPartyTable_P; DirPartyLocation dirPartyLocation_P; DirPartyLocationRole dirPartyLocationRole_P; LogisticsLocation logisticsLocation_P; LogisticsLocationRole logisticsLocationRole_P; LogisticsPostalAddress logisticsPostalAddress_P; LogisticsPostalAddress primaryAddress_P; while select custTable_P where custTable_P.AccountNum =='ED_01029' join dirPartyTable_P where dirPartyTable_P.RecId == custTable_P.Party join dirPartyLocation_P where dirPartyLocation_P.Party == custTable_P.Party && dirPartyLocation_P.IsPrimary==NoYes::Yes join dirPartyLocationRole_P where dirPartyLocationRole_P.PartyLocation == dirPartyLocation_P.RecId join logisticsLocationRole_P where logisticsLocationRole_P.RecId == dirPartyLocationRole

Get record from table on the basis of field id in Microsoft dynamics axapta x++

How to Get record from table on the basis of field id in dynamics axapta x++. just try following code in job to understand better way. emplTable emplTable; FieldId fieldId; ; fieldId = fieldNum(emplTable, Emplid); select emplTable; info(emplTable.(fieldId)); select emplTable where emplTable.(fieldId) == '1101'; info(emplTable.Name);