12.07.2015 Views

Mamut API

Mamut API

Mamut API

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Mamut</strong> <strong>API</strong>Sven Olav Rosnes, Senior consultant, Support16.03.2009api@mamut.com


<strong>Mamut</strong> <strong>API</strong>AgendaWhat is <strong>Mamut</strong> <strong>API</strong>?RequirementsConnecting to the databaseCode examplesExamples of usageQ & A


<strong>Mamut</strong> <strong>API</strong>What is <strong>Mamut</strong> <strong>API</strong>COM component called GBA<strong>API</strong><strong>API</strong>: Application Programming InterfaceAn interface for communicating with the MBS databaseSupports large parts of most major modules in MBSMost common use:Expand functionality by integrating other softwareImport data


<strong>Mamut</strong> <strong>API</strong>Requirements 1/2<strong>Mamut</strong> <strong>API</strong> licenseAny tool that supports ActiveX/COMWritten in Visual FoxPro but is language-independentMicrosoft WindowsData Execution Prevention OFFWin 2003 / XP: “Turn on DEP for essential Windows...”or Boot.ini /noexececute=AlwaysOffVista: Command prompt bcdedit /set nx alwaysoff


<strong>Mamut</strong> <strong>API</strong>Requirements 2/2MBS installed on the same machineDo not need to use MBS – only need to be installedNeed write access to the document areaDo not use the Example database (12.2.7007 and 7038)Only one version of MBS installed<strong>Mamut</strong> <strong>API</strong> registered in WindowsGBA<strong>API</strong> Reg.batAppPath in Registry etcReinstall/repair MBS to fix


<strong>Mamut</strong> <strong>API</strong>Connecting to the database 1/3Interim solutionWorks with MBS12, not MBS14oGBA.setclientpath() points to Database.ini1. oGBA = CreateObject("gbaapi.gba")2. oGBA.setclientpath("C:\Documents and Settings\All Users\Public<strong>Mamut</strong>\<strong>Mamut</strong>\_MBS12_7038\Data\system")


<strong>Mamut</strong> <strong>API</strong>Connecting to the database 2/3Permanent solutionConnectInfo class1. oGBA = CreateObject("GBA<strong>API</strong>.GBA")2. oconn = CreateObject("gbaapi.ConnectInfo")3. oconn.SetConnectBasicInfo(".", "MAMUT", 30, 1)4. oGBA.OpenConnection(oconn)


<strong>Mamut</strong> <strong>API</strong>Connecting to the database 3/3Connecting only to the system database1. oConn.PartialInit = TrueExample:Find <strong>Mamut</strong>.ini from IniFile in RegistryFind system database number in <strong>Mamut</strong>.iniConnect to system database onlyQuery the table g_clientConnect to system and client database


<strong>Mamut</strong> <strong>API</strong>Code examples 1/2Early binding / Late bindingRecommend Late bindingCheck “GBAe2apiErrors.txt “ for errorsLocated in “My Documents” (created when the first error occurs)May use ogba.Raiseexceptiononerror = TrueTo throw the error back to the applicationMay result in “Successfully...OK” error in VB 2005New field: g_contac.Custid, new meaning: g_contac.contidCreateNewByCustid(), GetByCustid()


<strong>Mamut</strong> <strong>API</strong>Code examples 2/2Newinit(oGBA)More important than beforeExamples:Create customerCreate productCreate invoiceCreate payment journal entry


<strong>Mamut</strong> <strong>API</strong>Examples of usagewww.integrasjonspartner.nowww.edi-soft.noEDI softwarewww.proline.noPOS etc.www.savanne.noBarcode scanning for sales orders and stocktaking+ many others


<strong>Mamut</strong> <strong>API</strong>Questions?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!