Codeunit variables – calling functions from other codeunits

In all code examples in this chapter, we created codeunits that contained functions used locally by codeunits themselves. But a codeunit is a code library that could contain common functionality available to other objects. The following section will show how to invoke functions from code libraries in C/AL:

LOCAL ExportPriceList(FileName : Text)    XMLDoc := XMLDoc.XmlDocument;    XMLDOMManagement.AddRootElement(XMLDoc,'PriceList',RootNode);    IF Item.FINDSET THEN        REPEAT            XMLDOMManagement.AddElement(RootNode,'Item',Item."No.",'',ItemNode);            XMLDOMManagement.AddAttribute(ItemNode,'Description',Item.Description);            XMLDOMManagement.AddAttribute(ItemNode,'Price',FORMAT(Item."Unit Price"));        UNTIL ...

Get Microsoft Dynamics NAV Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.