Search code examples
dynamics-navmicrosoft-dynamics-nav

Error to consume automation variable Dynamics 365 Business Central


I create an automation variable in Dynamics 365 Business Central On Premise.

This code work fine the first time but then an error apear.

Code:

EVALUATE(_PC, PCStr);

CREATE(_Export, TRUE, TRUE);

_Export.process(_PC);

Solution

  • This happen because you never clean your automation variable. You have to use CLEAR() sentence.

    Example:

    EVALUATE(_PC, PCStr);
    CLEAR(_Export);//to clean your automation
    CREATE(_Export, TRUE, TRUE);
    _Export.process(_PC);