classes\CustVendOpenTransBalancesManager\add

after declaration add this


 if (tmpBalances.TransOpenRecId)

    {

       //standard code
        tmpBalances.insert();
     }

Source :https://community.dynamics.com/ax/f/33/p/66455/123372.aspx

Please suggest for any other solution.