on 03-01-2017 7:48 AM - last edited on 02-03-2024 8:14 PM by postmig_api_4
Hi experts,
I want to modify Employee Master Data. To do it i have get the form to SAP Businees One Studio, added a tab folder,items and created a .srf file.
Now I want to show that my modified system form in the SAP B1.
public static void createSystemFormStudio(string fileName)
{
System.Xml.XmlDocument oXMLDoc;
oXMLDoc = new System.Xml.XmlDocument();
oXMLDoc.Load("../../" + fileName + ".srf");
SAPbouiCOM.Framework.Application.SBO_Application.LoadBatchActions(oXMLDoc.InnerXml);
}
I used this code but it gives me an error that
"Additional information: Form - Reserved / Illegal form Unique ID. Form Unique Id : 'F_21'" .
How can i solve this issue.
Thanks for your helps.
Regards.
Ahmet
Hi Ahmet,
You can do this:
Edit system form in B1 studio.
Then export your change as an Update Part.
After this you can use this new xml part in your add-on with a code like this: (just a sample)
private void SBO_Application_ItemEvent( string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent )
{
BubbleEvent = true;
if ( pVal.FormType == 60100 & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD && pVal.Before_Action == true )
{
oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount( pVal.FormType, pVal.FormTypeCount );
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD && pVal.Before_Action == true)
{
UpdateFormByXML("yourPartXml.xml", pVal.FormUID);
}
}
}
private void UpdateFormByXML(string sFileName, string sFormUID)
{
try
{
string sXPath = "Application//forms//action//form//@uid";
string sPath = System.Environment.CurrentDirectory + "\\";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(sPath + sFileName);
XmlNode xNode = xDoc.SelectSingleNode(sXPath);
xNode.InnerText = sFormUID;
string sXML = xDoc.InnerXml.ToString();
SBO_Application.LoadBatchActions(ref sXML);
}
catch (Exception ex)
{
SBO_Application.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, true);
}
}
P.S: This code above was provided by Owen Slater in this topic: https://archive.sap.com/discussions/thread/827583
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are the best.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ahmet,
I tried to create a folder and got the same situation. Maybe something is missing on the xml.
Look this document provided by SAP: http://docshare.tips/sap-business-one-loading-xml_5775b1bab6d87fbe328b48bd.html
In this sample there is a code and xml that adds two tabs on the Sales Order Form. Try read and find what is missing or what is wrong with your xml generated by B1 Studio.
Kind Regards,
Diego Lother
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.