cancel
Showing results for 
Search instead for 
Did you mean: 

SAP B1 System Form Modifying

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor

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

m_felicella
Participant

You are the best.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Diego,

I did your suggestion, i created a button, tab folder and items for the tab that named "Bordro".

when i run my addOn

Button is shown but tab folder not.

How can i shown my tab folder in system form.

Thanks for your helps.

Regards.

Ahmet

former_member185682
Active Contributor

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

Former Member
0 Kudos

Hi Diego,

I did that what the pdf file said.

My tab is created.

I can click the tab folder but i cant see the tab.

Do you have any suggestion about it ?

P.S : My tab name is "Bordro" isn't "Ekler". "Ekler" is "Attachments" tab in English. I clicked but it doesnt shown.

Thanks,

Regards

Ahmet

Former Member
0 Kudos

Ah!

I solved it 🙂

I was put just a GroupWith function to my tab folder.

Thanks for your all helps Diego.

Regards

Ahmet