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
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 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.