cancel
Showing results for 
Search instead for 
Did you mean: 

get new object key from blanket agreement

0 Kudos
284

Hi, i'm trying to get the key when I add a new blanket agreement.

Here is my code so far.

private void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo pVal, out bool BubbleEvent)
{
BubbleEvent = true;
if (pVal.FormTypeEx == "1250000100" && pVal.BeforeAction == false)
{
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD && pVal.ActionSuccess == true)
{
try
{
string LocDocEntry = "";
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.LoadXml(pVal.ObjectKey);
LocDocEntry = "";
string sDocType = pVal.Type;
}
catch (Exception ex)
{
SBO_Application.MessageBox("Error :: " + ex.Message);
}
}
}
}

However the PVal is empty, is there any function or something I can use?

Please help me,

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Maybe it's not the best method but I used the following query

string sSql = "SELECT TOP 1 T0.AbsID FROM OOAT T0 INNER JOIN OUSR T1 ON T0.UserSign = T1.USERID WHERE T0.Cancelled = 'N' AND (CAST(T0.CreateDate AS DATE) = CAST(CURRENT_TIMESTAMP AS DATE)) AND T1.USER_CODE = '" + _oCompany.UserName + "' ORDER BY T0.AbsID DESC";