Regarding Argument

Hi Pioneers,

I am new to Axapta, while surfing to a class, I noticed the following in a method:

public void UploadFile(DocuView docuView, FileName filename = ’ ')

{

// logics

}

Kindly let me know, what is the meaning of FileName fileName = ’ ’ ? As in rest parts of the programming, where the fileName or FileName is getting used, the whole file path along name is coming. I was thinking that by writing FileName fileName = ’ ', we are NULLing the value. Please correct me if I am wrong.

fileName = ‘’ is an optional parameter. If you provide any value to it, it’s used as in any other parameter. But if omit the parameter completely when calling the method (in this case, you would call UploadFile() with a single parameter only), the optional value is used.

As you can see, optional parameters allows you to call one method with different number of parameters in a similar way as in languages with method overloading (which is not supported in X++).