cancel
Showing results for 
Search instead for 
Did you mean: 

Create Button on Purchase Order

ramco1917
Participant
0 Kudos
90

Hi

   I have below code to connect to a Company. Now want to create a button in Purchase Order form as Send Email.

oCompany = new SAPbobsCOM.Company();
oCompany.Server = "NDB@10.0.1.28:30015";
oCompany.DbServerType = BoDataServerTypes.dst_HANADB;
oCompany.CompanyDB = "LIVE_Database";
oCompany.UserName = "manager";
oCompany.Password = "123";
oCompany.language = BoSuppLangs.ln_English;
oCompany.UseTrusted = true;

int connectionResult = oCompany.Connect();
if (connectionResult != 0)
{
throw new Exception("Error connecting to SAP Business One: " + oCompany.GetLastErrorDescription());
}

Thanks

View Entire Topic
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ramco1917 ,

If you have installed SAP Business One SDK, you can refer to the sample code in the following location:

C:\Program Files (x86)\sap\SAP Business One SDK\Samples\COM UI\CSharp\11.SystemFormManipulation

This sample demonstrates how to customize a System Form.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

ramco1917
Participant
0 Kudos

Hi Ankit

  Please just help me how to get created oApplication Object as per my above code

Thanks

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ramco1917 ,

oApplication is the object to connect to SAP Business One application (For making UI API connection).

In order to create a Button on System Form (Purchase Order in this case), you first need to make a UI API connection as mentioned in the sample code which I shared in my previous answer.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support