on 05-05-2017 7:56 AM
oFormUDF = ClsSBOAddOn.SBOApplication.Forms.GetForm("-133", 1);
iOprqNo = Convert.ToInt32(((SAPbouiCOM.EditText)oFormUDF.Items.Item("U_OPRNO").Specific).Value.ToString());
oSalesOpprtunities = (SAPbobsCOM.SalesOpportunities)ClsSBOAddOn.SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSalesOpportunities);
int iLine = 0;
// int iRow = oMatrix.VisualRowCount;
if (oSalesOpprtunities.GetByKey(iOprqNo) == true)
{
if (iLine < oSalesOpprtunities.Lines.Count)
{
//oSalesOpprtunities.Lines.SetCurrentLine(iLine);
oSalesOpprtunities.Lines.MaxLocalTotal = 200;
string assa = oSalesOpprtunities.Lines.Count.ToString();
oSalesOpprtunities.Lines.SetCurrentLine(oSalesOpprtunities.Lines.Count-1);
//if (oSalesOpprtunities.Lines.LineNum == Convert.ToInt32(sOOPline))
//{
oSalesOpprtunities.Lines.DocumentNumber = Convert.ToInt32(oDBHeader.GetValue("DocEntry", 0));
iOprtStatus = oSalesOpprtunities.Update();
if (iOprtStatus != 0)
{
int ErrorCode = 0;
string ErrorMessage = "";
ClsSBOAddOn.SBOCompany.GetLastError(out ErrorCode, out ErrorMessage);
BubbleEvent = true;
return;
}
//break;
// }
iLine++;
}
}
<br>
My Code
Hi mohammad asharaf,
Here is how to update an existing Stage on the Sales Opportunity:
SAPbobsCOM.SalesOpportunities oSalesOppr = (SAPbobsCOM.SalesOpportunities)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSalesOpportunities);
oSalesOppr.GetByKey(69);
oSalesOppr.Lines.StageKey = 1;
oSalesOppr.Lines.StartDate = DateTime.Today.AddDays(2);
int Up = oSalesOppr.Update();
Kind regards,
ANKIT CHAUHAN
SAP SME Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if (oSalesOpprtunities.GetByKey(iOprqNo) == true)
{
if (iLine < oSalesOpprtunities.Lines.Count)
{
string assa = oSalesOpprtunities.Lines.Count.ToString();
oSalesOpprtunities.Lines.Add();
oSalesOpprtunities.Lines.MaxLocalTotal = 200;
oSalesOpprtunities.Lines.SetCurrentLine(2);
//if (oSalesOpprtunities.Lines.LineNum == 2)
//{
oSalesOpprtunities.Lines.DocumentNumber = Convert.ToInt32(oDBHeader.GetValue("DocEntry", 0));
//}
iLine++;
}
}
Hi,
Try this:
SAPbobsCOM.SalesOpportunities oSalesOppr = (SAPbobsCOM.SalesOpportunities)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSalesOpportunities);
oSalesOppr.GetByKey(69);
oSalesOppr.Lines.StageKey = 1;
oSalesOppr.Lines.DocumentType = SAPbobsCOM.BoAPARDocumentTypes.bodt_Order;
oSalesOppr.Lines.DocumentNumber = 369;
int Up = oSalesOppr.Update();
Kind regards,
ANKIT CHAUHAN
SAP SME Support
i am add document no at second line then after third line .
lust like
sales order - 14
Invoice - 2
oSalesOpprtunities.Lines.SetCurrentLine(oSalesOpprtunities.Lines.Count - 1);
oSalesOpprtunities.Lines.MaxLocalTotal = 200;
oSalesOpprtunities.Lines.DocumentNumber = Convert.ToInt32(oDBHeader.GetValue("DocEntry", 0));
oSalesOpprtunities.Lines.Add();
Hi mohammad asharaf,
In that case, I would request you to tell us what did you do in order to resolve the issue.
Also it would be nice, if you can close this thread by marking the correct answer.
Kind regards,
ANKIT CHAUHAN
SAP SME Support
also give one Error : Cannot update closed row [OPR1.Line][line: 1]
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.