on 09-15-2014 8:13 AM
Hi people!
I opened an edit form in SAP B1, added a button and now i want to save the changed form in SAP B1. How can i do it? I have saved its file as xml and srf but how to import it to SAP B1?
Hello,
You can use this code:
In Menu Event
For example
if (pVal.MenuUID == "2053" && pVal.BeforeAction)
{
var s = File.ReadAllText(@"fileName.srf");
_sboApplication.LoadBatchActions(s);
bubbleEvent = false
}
and then you must implement in ItemEvent,
if (pVal.FormType == 133 & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD && pVal.Before_Action == true)
{
var oOrderForm = _sboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD && pVal.Before_Action == true)
{
string sXPath = "Application//forms//action//form//@uid";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(@"D:fileNamesrf");
XmlNode xNode = xDoc.SelectSingleNode(sXPath);
xNode.InnerText = formUid;
string sXML = xDoc.InnerXml.ToString();
_sboApplication.LoadBatchActions(ref sXML);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi.
if u r file is saved in .srf file i am using the below code ...
at any event once the event is fired use below code..
normally people are writing at menu event....
Try
If (pVal.BeforeAction = False And pVal.MenuUID = "ENQUIRY") Then
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\" & "TimeSheetEnquiry.srf")
objAddOn.objApplication.LoadBatchActions(oXmlDoc.InnerXml)
oform = objAddOn.objApplication.Forms.Item("TIMESHEETENQ")
here sPath is where your file is located......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
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.