cancel
Showing results for 
Search instead for 
Did you mean: 

Add Button in Sales Order

ramco1917
Participant
0 Kudos
167

Hi

  I have below code . I want to add button in Sales Order Form after Cancell Button

SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();
SAPbouiCOM.Application oApplication = new SAPbouiCOM.Application();

oCompany.Server = "10.0.1.28:30015";
oCompany.DbServerType = BoDataServerTypes.dst_HANADB;
oCompany.CompanyDB = "Test_LIVE";
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

Accepted Solutions (0)

Answers (4)

Answers (4)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ramco1917 ,

Install SAP Business One SDK from SAP Business One Patch Package.

Then, you can refer to the sample project "11.SystemFormManipulation" from the following location:

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

It will help you.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

nidhisingh14
Product and Topic Expert
Product and Topic Expert
0 Kudos
ramco1917
Participant
0 Kudos
Hi, i want to add button on any Form. Connection is o.k. Can you please help with sample code.
williamwachholz
Active Participant
0 Kudos

Taken from the SDK Sample

 

SAPbouiCOM.Button oButton = null;

oItem = oForm.Items.Add( "1", SAPbouiCOM.BoFormItemTypes.it_BUTTON );
oItem.Left = 6;
oItem.Width = 65;
oItem.Top = 51;
oItem.Height = 19;

oButton = ( ( SAPbouiCOM.Button )( oItem.Specific ) );

oButton.Caption = "Ok";

 

williamwachholz
Active Participant
0 Kudos

Hello,

Your code is not adding the button in the form. You need to write the code to catch the event of the application corresponding to the sales order form loading and then create the button on it.

There is plenty of samples in the SDK documentation on how to do this.

Best regards

ramco1917
Participant
0 Kudos

Hi, Can you please provide a sample code.

It is just for Connection. Now i want to Add Button. Kindly help.