cancel
Showing results for 
Search instead for 
Did you mean: 

Sap business studio

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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);

                    }

                }

Former Member
0 Kudos

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......