on 09-08-2008 1:53 PM
Hello Experts,
I want to add a new Activity using C#. Can anyone help me, by giving example code?
Best regards
ES.
This is a method we use to create an activity when we send a BP our Brochure....information is coming from a grid within a form and is being used to create the activity.
private void UpdateBrochu(int nSelected) // form update to db
{
SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)theForm.Items.Item("grdBrochr").Specific;
// add activity to database..............................................................................................
int nErr = 0;
string sErr = "";
SAPbobsCOM.Contacts oACT = ((SAPbobsCOM.Contacts)(theCompany.GetBusinessObject (SAPbobsCOM.BoObjectTypes.oContacts)));
oACT.CardCode = m_sCardCode;
oACT.Details = "Brochure to be Sent: " + oGrid.DataTable.GetValue("Item", nSelected).ToString() + " "
+ oGrid.DataTable.GetValue("Description", nSelected).ToString();
oACT.Notes = "Brochure to be Sent.";
oACT.ContactDate = System.DateTime.Now;
oACT.Add();
theCompany.GetLastError(out nErr, out sErr);
if (nErr != 0)
theApp.MessageBox("Your record was not able to be added.\nError: " + sErr, 1, "Ok", "", "");
else
{
theApp.StatusBar.SetText("Operation Completed Successfully.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
}
}
Hopes this helps.
Mitch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.