In Class InventMov_Sales, there is a new() (Constructor), Please help me in understanding the second parameter, what does _inventType contains.
Is SalesLineType::Construct(_salesOrderLine) refering to constructor in SalesLineType class?
In Class InventMov_Sales, there is a new() (Constructor), Please help me in understanding the second parameter, what does _inventType contains.
Is SalesLineType::Construct(_salesOrderLine) refering to constructor in SalesLineType class?
It’s an optional parameter. If you provide a value for the second parameter, it’s used as usually. But if you call the method with the first parameter only, the value of the second parameter is set to the result of SalesLineType::construct(_salesOrderLine).
construct() is not a constructor, it’s a static method that creates a various subtypes of SalesLineType class. Such a method is often called a factory method. If you want to see what exactly SalesLineType::construct() does, simply open it in code editor and take a look.
Thank you… this cleared my doubt…