Skip to main content

Posts

Showing posts with the label print all types

exception handling in X++ MSDAX

Try-catch statements are used for exception handling in X++. A try-catch statement consists of two or more separate blocks of code, a try block which attempts some operation, and one or more catch blocks where exceptions thrown within the try block are caught. Exceptions may either be thrown by the kernel or by using the command throw from code within the try block. The catch part takes action on exceptions. You may have multiple catch blocks, each designed to catch a particular type of exception. Action will only be taken on types of exceptions explicitly referenced in your code. The try-catch example shown will take action on the exception type's error and warning. static void Intro_TryCatch(Args _args) { Counter counter; try { while (counter < 10) { counter++; if (counter MOD 7 == 0) throw error("Counter MOD 7 is zero"); if (counter MOD 3 == 0) throw warning("Counter MOD 3 is zero"); } } catch (Exception::Erro

Introduction of base type in MSD axapta

Description myString = "A X++ string"; Counter myInteger = 100; Qty myReal = 12.25; TransDate myDate = str2Date('12-31-2005', 213); TimeHour24 myTime = str2Time('14:05'); NoYesId myEnum = NoYes::Yes; PackedQueryRun myContainer = ['12', 'test', 'tada']; AnyType myAnyType = systemdateget(); ; print myString; print myInteger; print myReal; print myDate; print myTime; print myEnum; print conPeek(myContainer, 1); print myAnyType; pause;