on 03-22-2017 4:25 AM - last edited on 02-03-2024 9:59 PM by postmig_api_4
Hi
Am trying to add new sale opportunity stages by using below code.
But it is updating existing row only.
If is there any wrong, please let me know.
Dim sales As SAPbobsCOM.SalesOpportunities = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSalesOpportunities), SAPbobsCOM.SalesOpportunities)
If sales.GetByKey(oOpportunity) Then
sales.Lines.SetCurrentLine(sales.Lines.Count - 1)
sales.Lines.PercentageRate = 100
sales.Lines.StageKey = 33
sales.Lines.StartDate = DateTime.Today
sales.Lines.ClosingDate = oDeliveryDate
sales.Lines.Add()
If sales.Update <> 0 Then
Dim error1 As String = oCompany.GetLastErrorDescription
show += error1
show += "');"
ScriptManager.RegisterStartupScript(Me, [GetType](), "Show", show, True)
End If
Hi Nandappa,
If this statements
sales.Lines.PercentageRate = 100
sales.Lines.StageKey = 33
sales.Lines.StartDate = DateTime.Today
sales.Lines.ClosingDate = oDeliveryDate
should create a new stage, the correct code must be this:
sales.Lines.SetCurrentLine(sales.Lines.Count - 1)
sales.Lines.Add()
sales.Lines.PercentageRate = 100
sales.Lines.StageKey = 33
sales.Lines.StartDate = DateTime.Today
sales.Lines.ClosingDate = oDeliveryDate
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I tried to add more than one line in stages of opportunity but there is no luck, below are my codes (in PHP)
$oOpport->Lines->SetCurrentLine(0);
$oOpport->Lines->MaxLocalTotal=$Potentialamount;
$oOpport->Lines->StageKey=$Stageid;
$oOpport->Lines->SalesPerson=$Salesid;
$oOpport->Lines->DataOwnershipfield=$Ownerlinesid;
$oOpport->Lines->Add;
Error message is Notice: Trying to get property of non-object in C: Error: -5002
One line is added successfully but more than one line is not added.
Please anyone can help me
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
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.