on 09-11-2008 5:54 PM
Hello to all, he would need some example of exportation and import of formattedSearch to XML. Thank you very much.
Hi Andreas,
i made a c# code for you
Export
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);
Import
string FileName = "C:\\TEST.xml";
oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
oFS = ((SAPbobsCOM.FormattedSearches)(oCompany.GetBusinessObjectFromXML(FileName, 0)));
if (oFS.Add() == 0)
{
Console.WriteLine("Added");
}
else
{
Console.WriteLine(globals.oCompany.GetLastErrorDescription());
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andres,
If you need an xml for copy userQuery's from one database to another, you can beter use copyexpress...
If you don't need it ignore this message..
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
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.