on 09-10-2008 6:58 PM
Hello, since I can export formatted search to XML and despues be able to import them. Thank you.
Hi,
ater a look in the SDK DIAPI documentation:
use the FormattedSearches Object
with the Method GetAsXML
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Later do I import it with the load as a common XML?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andres,
i recommend you the following:
first try to export a formatted search with
SaveXML method.
the result is a XML that you can than import with GetAsXML
try first SaveXML (i thought you've done that already), look how the XML looks
and than try to import the XML in another company.
thats how you do it with DIAPI.
lg David
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
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
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.