Skip to Content
0

SAP B1 System Form Modifying

Mar 01, 2017 at 07:48 AM

166

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

DIEGO LOTHER Mar 02, 2017 at 12:02 PM
0

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


img1.png (21.1 kB)
img2.png (8.2 kB)
Share
10 |10000 characters needed characters left characters exceeded
Ahmet Emin Pehlivan Mar 02, 2017 at 02:25 PM
0

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


emd01.jpg (38.0 kB)
emd02.jpg (54.6 kB)
emd01.jpg (138.7 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

1

Ah!

I solved it :)

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

Thanks for your all helps Diego.

Regards

Ahmet

0

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

emd01.jpg (72.7 kB)
0