Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Add Sales Opportunities form using SDK.

Hello,

I have created an asp to add Sales Opportunities.

I wanna add it but not getting all the fields using SAPbobsCOM.

My Code which I am using is:-    

SAPbobsCOM.SalesOpportunities oSalesOpportunitiy = (SAPbobsCOM.SalesOpportunities)oCompany.GetBusinessObject(BoObjectTypes.oSalesOpportunities);

                    SAPbobsCOM.BoSoOsStatus status = new BoSoOsStatus();

                    if (Request.Form["status"] == "Open")

                    {

                        status = BoSoOsStatus.sos_Open;

                    }

                    else if (Request.Form["status"] == "Close")

                    {

                        status = BoSoOsStatus.sos_Missed;

                    }

                    else

                    {

                        status = BoSoOsStatus.sos_Sold;

                    }

                  

                    oSalesOpportunitiy.CardCode = Request.Form["BPCode"];

                    oSalesOpportunitiy.CustomerName = Request.Form["BPName"];

                    oSalesOpportunitiy.ContactPerson = Convert.ToInt32(Request.Form["ContactPerson"]);

                    oSalesOpportunitiy.SalesPerson = Convert.ToInt32(Request.Form["SalesEmployee"]);

                    oSalesOpportunitiy.Lines.MaxLocalTotal = Convert.ToDouble(Request.Form["PotentialAmount"]);

                    oSalesOpportunitiy.Status = status;

                    oSalesOpportunitiy.StartDate = Convert.ToDateTime(Request.Form["StartDate"]);

                    oSalesOpportunitiy.PredictedClosingDate = Convert.ToDateTime(Request.Form["PredictedClosingDate"]);

                   

                    oSalesOpportunitiy.BPChanelCode = Request.Form["BPChannelCode"];

                    oSalesOpportunitiy.BPChanelName = Request.Form["BPChannelName"];

                    oSalesOpportunitiy.BPChannelContact = Convert.ToInt32(Request.Form["BPChannelContact"]);

                    oSalesOpportunitiy.OpportunityName = Request.Form["OppName"];

                    oSalesOpportunitiy.ProjectCode = Request.Form["BPProject"];

                    oSalesOpportunitiy.Territory = Convert.ToInt32(Request.Form["BPTerritory"]);

                    oSalesOpportunitiy.Source = Convert.ToInt32(Request.Form["InformationSource"]);

                    oSalesOpportunitiy.Remarks = Request.Form["remark"];

                   

                    if (oSalesOpportunitiy.Add() != 0)

                    {

                        string error = oCompany.GetLastErrorDescription();

                        Response.Write(error);

                    }

                    oCompany.Disconnect();

Some of the fields I got but not the all.

So, Please help me and suggest me the rest of the fields.

Former Member
Not what you were looking for? View more on this topic or Ask a question