Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Export/import formatted search to XML

Hello to all, he would need some example of exportation and import of formattedSearch to XML. Thank you very much.

Former Member

Hi Andreas,

i made a c# code for you


string FileName = "C:\\TEST.xml";

SAPbobsCOM.FormattedSearches oFS = null;
oFS = ((SAPbobsCOM.FormattedSearches)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)));

oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;

oFS.GetByKey(1); // IndexID from CSHS table
oFS.SaveXML(ref FileName);


string FileName = "C:\\TEST.xml";

oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
oFS = ((SAPbobsCOM.FormattedSearches)(oCompany.GetBusinessObjectFromXML(FileName, 0)));
if (oFS.Add() == 0)

this code worked for me - but remember that formatted searches can only be assigned once to a field

actually i pray that you wanted this and not userqueries

lg David

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question