Hi Cenk!

 

Is there any particular reason as to why you have to do it this way?

 

If not then then what you could potentially do is…

 

Take 2 identical PO’s, reset the status back to created, increase PO quantity of main PO, delete child PO and the increase the status of the main PO to whatever it was earlier (estimated or released). It is easier to do it this way.

 

 

Regards

 

harry

 

 
 
 
Harry Deshpande
Senior Consultant
CGNZ Middle Market Solutions
Ph +64 29 277 5133
Fax +64 9 358 1018
 
CGNZ Limited and its predecessor organisations (Cap Gemini Ernst & Young, and Ernst & Young Consulting) have a proud track record of market leadership and excellent service delivery in all areas of systems delivery both for New Zealand clients and in supporting regional and global projects.  CGNZ is a licensed affiliate of Cap Gemini S.A. (one of the world’s leading management consulting and IT services companies), wholly owned by NZ employee-shareholders, with over 150 IT professionals in our Auckland and Wellington offices.  Middle Market Solutions specialises in the implementation of business solutions for small corporate and middle market companies.  The core activity of our team is the implementation and support of Enterprise Resource Planning (ERP), Customer Relationship Management (CRM), E-Business solutions and related technologies from Microsoft Business Solutions.  Find out more about what we do at http://www.cgnz.com/middlemarketsolutions
 
CGNZ DISCLAIMER: This email and any attachments are confidential and intended exclusively for the person to whom the email is addressed. If you are not the intended recipient, do not read, copy, disclose or use the contents in any way. Please notify us immediately by return email and destroy the email and attachments. CGNZ does not accept any liability for any changes made to this email or attachments after sending by CGNZ. You must scan this email and attachments for viruses. The opinions expressed are not necessarily those of CGNZ. 
 
CGNZ accepts no liability for any loss, damage or consequence, whether caused by our own negligence or not, resulting directly or indirectly from the use of this email and attachments.
 

From: Cenk Ince [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 12 January 2005 9:10 a.m.
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: Make 2 Production Order, 1 Production Order.

 

Hi all;

I make some modificationas on prodtable. I have 2 PO and i want to make them 1 PO if they have same route, same itemid and same bom.
But when i make union them with code below i lose inventtrans references. How can i keep references?

Thanks

void UnionPO(ProdId ProdIdMain,ProdId ProdIdChild)
{
    ProdTable   ProdMain,ProdChild;
    ProdBOMCalc ProdBOMCalc;
    ;
    ttsBegin;
    SELECT FORUPDATE ProdMain WHERE ProdMain.ProdId == ProdIdMain;
    SELECT FORUPDATE ProdChild WHERE ProdChild.ProdId == ProdIdChild;

    WHILE SELECT FORUPDATE ProdBOMMain
        WHERE   ProdBOMMain.ProdId == ProdMain.ProdId
    {
        SELECT FORUPDATE ProdBOMChild
            WHERE ProdBOMChild.ProdId == ProdChild.ProdId &&
                  ProdBOMChild.ItemId == ProdBOMMain.ItemId &&
                  ProdBOMChild.LineNum== ProdBOMMain.LineNum;
        ProdBOMMain.QtyBOMCalc = ProdBOMMain.QtyBOMCalc + ProdBOMChild.QtyBOMCalc;
        InventMovement::setMinMaxQty(prodBOMMain);
        InventMovement::bufferSetTransQtyUnit(prodBOMMain);
        ProdBOMMain.update(true);
        WHILE SELECT FORUPDATE InventTransChild
            WHERE InventTransChild.InventTransId == ProdBOMChild.InventTransId
        {
            InventTransChild.InventTransId = ProdBOMMain.InventTransId;
            InventTransChild.update();
        }

        ProdBOMChild.delete();
    }
    ProdMain.QtySched += ProdChild.QtySched;
    ProdChild.delete(false);
    ProdMain.update();
    ttsCommit;
}



Sharing the knowledge on Axapta.



Yahoo! Groups Links

Reply via email to