cancel
Showing results for 
Search instead for 
Did you mean: 

Add Sales Opportunities form using SDK.

ravi_sharma9390
Explorer
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

maik_delly
Active Contributor
0 Kudos

Hi Ravi,

in general most of ( ! ) all fields are available through DI API. But unfortunately they are called differently in ( client <> database <> SDK ).

I usually check the database field name and search for it in SDK help. If you have no luck : what are the missing fields ?

regards,

Maik

ravi_sharma9390
Explorer
0 Kudos

I finally got all the fields.

Sorry for late reply Maik and thanks for your concern.