on 06-14-2021 7:15 PM
Dear fitt,
In order to get Order No. and Row No., you need to use something like this:
oDoc.Lines.BaseType = 202; //Production Order Object Type
oDoc.Lines.BaseEntry = 30; // Production Order DocEntry
oDoc.Lines.BaseLine = 1; //Line No. from Production Order
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the recommendation but still my code is not generating any new Issue to production, even I put some validations to check if the information is getting some error or something but no error and just don’t generate. Could you please check my code and see if something is not correct?
if (!oCompany.InTransaction)
oCompany.StartTransaction();
SAPbobsCOM.Documents oDoc = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit);
oDoc.Lines.BaseType = 202; //Production Order Object Type
oDoc.Lines.BaseEntry = 152;
oDoc.Lines.BaseLine = 1; //Line No. from Production Order
//oDoc.Lines.BatchNumbers.Quantity = 100;
//oDoc.Lines.BatchNumbers.BatchNumber = "MP-MP-MP";
//oDoc.Lines.BatchNumbers.ManufacturerSerialNumber = "MP-MP-MP";
//oDoc.Lines.BatchNumbers.InternalSerialNumber = "MP-MP-MP";
oDoc.Lines.Quantity = 100;
//oDoc.Lines.ItemCode = "828282";
//oDoc.Lines.BinAllocations.Quantity = 1200;
//oDoc.Lines.WarehouseCode = "MP";
//oDoc.Lines.BinAllocations.BinAbsEntry = 1;
//oDoc.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
//oDoc.Lines.FreeText = "Test";
//oDoc.GetByKey(41);
oDoc.Comments = "Prueba";
int ret1 = oDoc.Add();
string res1 = oDoc + ":" + oCompany.GetLastErrorDescription();
TextBox1.Text = Convert.ToString(oDoc.Add());
if (ret1 == 0)
{
lblNoOrden.Visible = true;
if (oCompany.InTransaction)
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);
}
else
if (oCompany.InTransaction)
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);
if (res1.Length > 1)
lblProceso.Visible = true;
}
}
catch
{
lblProYaReg.Visible = true;
}
}
}
}
Dear fitt,
Kindly check the Documents object under SDK Help File which should help you:
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer ANKIT, indeed the objects that you mentioned are the one that has to be used to achieve the DI, but I'm still facing some trouble about getting to those specific fields that I show on the attached image.
Let me share you me code:
oCompany.StartTransaction();
SAPbobsCOM.Documents oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry); oDoc.Comments = "Test";
oDoc.Lines.ItemCode = "8200103";
oDoc.Lines.Quantity = 2000;
oDoc.Lines.FreeText = "Test";
Cannot find the "Order No" Field, the "Row. No." and I think I got quantity.
Do you have any code that you can share to get these fields?
Dear fitt,
The following code works fine for me:
SAPbobsCOM.Documents oIssueForProduction = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit);
oIssueForProduction.Lines.BaseEntry = 155;
oIssueForProduction.Lines.BaseType = 202;
oIssueForProduction.Lines.BaseLine = 0;
oIssueForProduction.Lines.Quantity = 5;
int AIFP = oIssueForProduction.Add();
The Issue Method on Production Order for my Item is Manual.
Hope it helps!
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.