This post is machine-translated. The original post in german language can be found here.

Release Product

You can use the following line code to release a product in another company:

EcoResProductReleaseSessionManager ecoResProductReleaseSessionManager;
    
ecoResProductReleaseSessionManager = 
EcoResProductReleaseSessionManager::newReleaseSession();

ecoResProductReleaseSessionManager.addProduct(52565549190);
ecoResProductReleaseSessionManager.addLegalEntityForAllProducts(
CompanyInfo::findDataArea('USP2').RecId);

if( !ecoResProductReleaseSessionManager.execute())
{
    error("An error occured");
}

If you want to release several products at once, this is also possible. In the next example, several products are released in different companies:

EcoResProductReleaseSessionManager ecoResProductReleaseSessionManager;
    
ecoResProductReleaseSessionManager = 
EcoResProductReleaseSessionManager::newReleaseSession();

ecoResProductReleaseSessionManager.addProduct(52565549189);
ecoResProductReleaseSessionManager.addLegalEntityForProduct(
    CompanyInfo::findDataArea('USP2').RecId, 
    52565549189);
ecoResProductReleaseSessionManager.addLegalEntityForProduct(
    CompanyInfo::findDataArea('USRT').RecId, 
    52565549189);

ecoResProductReleaseSessionManager.addProduct(52565549187);
ecoResProductReleaseSessionManager.addLegalEntityForProduct(
    CompanyInfo::findDataArea('USPI').RecId, 
    52565549187);
ecoResProductReleaseSessionManager.addLegalEntityForProduct(
    CompanyInfo::findDataArea('USRT').RecId, 
    52565549187);

if( !ecoResProductReleaseSessionManager.execute())
{
    error("An error occured");
}

It is important to note that in the event of an error during release, the process will not be aborted. Products which could not be released can be found in the form Open product releases where you can also view the infolog.

Open product releases 

These post applies to following version:
Dynamics AX 2012

 
 

 

 
 
 
Posts of the actual month
Juni 2025
MoTuWeThFrSaSu
 1
2345678
9101112131415
16171819202122
23242526272829
30 
 
© 2006-2025 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.