on 08-25-2011 6:32 PM
Hi,
I am trying to update the document before it gets created in the database using FormDataEvent (FORM_DATA_ADD, BeforeAction = True). it always give me an error. Do we allow to do that within FormDataEvent ?
Regards,
David
you can update just by UI, what are you trying to update?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please post you code
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my code. It doesn't work with FormDataEvent.
void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)
{
BubbleEvent = true;
try
{
if (BusinessObjectInfo.FormTypeEx == "133" && BusinessObjectInfo.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD && BusinessObjectInfo.BeforeAction)
{
{
// 10% discount on the document
((SAPbouiCOM.EditText) (SAPbouiCOM.EditText)SBO_Application.Forms.Item(BusinessObjectInfo.FormUID).Items.Item("24").Specific).Value = "10";
}
}
}
catch (Exception e)
{
Debug.Print(e.ToString());
}
}
And it worked fine with ItemEvent
void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;
try
{
if (pVal.FormTypeEx == "133" && pVal.ItemUID == "1" && pVal.BeforeAction && pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
{
{
// 10% discount on the document
((SAPbouiCOM.EditText) (SAPbouiCOM.EditText)SBO_Application.Forms.Item(FormUID).Items.Item("24").Specific).Value = "10";
}
}
}
catch (Exception e)
{
Debug.Print(e.ToString());
}
}
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.