12 Eylül 2012 Çarşamba

AXAPTA - X++ If and blocks

This code part below has mistake?


            if (_ServiceShipment == B_SMAServiceShipment::B_Hand)
                if (!Personels.WithHand)
                    continue;
I was thinking not. Because I thought second if with continue should be consider as one command. But it seem not. Requires paranthesis:

            if (_ServiceShipment == B_SMAServiceShipment::B_Hand)
            {
                if (!Personels.WithHand)
                    continue;
            }

4 Haziran 2012 Pazartesi

Hide lookup button for a form control

Hide lookup button for a form control:

 DSerial.lookupButton(FormLookupButton::Never);

20 Nisan 2012 Cuma

AXAPTA - Using common DLL

Put your DLL file at Client\Bin at  Axapta folder under Program Files. That folder's name is :
C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\
at my PC.


Set parameters with extTypes enum at Arg method. Sample usage:


void Test()
{
    DLL                 testDll;
    DLLFunction         test;
    ;

    testDll = new DLL("MyTestDLL.dll");
    test = new DLLFunction(printDLL, "MyTestingMethod");
    test.arg(extTypes::Word ,extTypes::String);
   test.call(12345,"ABCDE");
}

6 Nisan 2012 Cuma

AXAPTA - ascii character and string length

mylen = StrLen("my string...");

my_first_chr = num2char(65);

AXAPTA - Declare global function

Add your static method at AOT->classes->Global:

public static void Test()
{
;
info("my global function");
}

***
static void TestMyGlobalFunction(Args _args)
{
;
test();
}

AXAPTA - Trimming a string

static void Job47(Args _args)
{
str a;
;
a=StrRtrim("fdssf ");
a=StrLtrim(" fdssf");
}

7 Şubat 2012 Salı

AXAPTA Write a message and return false at validate

This can be do with Checkfailed in one line instead of two lines:

if (b_SerialTrans.RefType !=B_SerialRefType::ServiceObjectRelation)
        return checkFailed("Record cannot be delete!..");