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

Add comment

 

 
 
 
posts of the actual month
Januar 2019
MoDiMiDoFrSaSo
 123456
78910111213
14151617181920
21222324252627
28293031 
 
 
© 2006-2019 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.