We would like a little guidance on using the readrecord method of the salesquoteobject when initialising the object from script. We use this successfully from within quote breakout's, so can only assume we have not initialised the object correctly.
- Code: Select all
Set myDatabase = CreateObject("jiwaodbc.database")
Set JiwaCommLib = CreateObject("JiwaCommonLib.StdFunctions")
Set JiwaLib = CreateObject("JiwaLib.StdFunctions")
myDatabase.Connectiondetails = "Correct String here removed for forum..."
myDatabase.IniFile = "Correct String here removed for forum..."
Set SystemProfile = CreateObject("JiwaSysProfile.clsSysProfile")
If myDatabase.MakeConnections(0) Then myDatabase.DoLogOn("Admin", "correct password removed here for forum..")
'############### Create and Open existing Jiwa Quote Object
Set SalesQuoteObject = CreateObject("JiwaSalesQuote.clsSalesQuote")
Set SalesQuoteObject.Database = myDatabase
Set SalesQuoteObject.JiwaCommLib = JiwaCommLib
Set SalesQuoteObject.JLib = JiwaLib
Set SalesQuoteObject.SystemProfile = SystemProfile
SalesQuoteObject.Setup 'Needed?
SalesQuoteObject.ReadDefaultBranch 'Needed?
myVal = SalesQuoteObject.ReadRecord(0, 1, "QU000027434")
wscript.Echo Chr(10) & "Return Value: " & myVal 'Expect -1 for success
wscript.Echo SalesQuoteObject.ErrorString
if myVal <> 1 then exit sub
The return code we are receiving on ReadRecord is "0" for failure, with the errorstring of "Error On Fetch : clsRecordSet.FetchRow - No Data Found". I am sure this is a simple case of neglecting to setup the object correctly.
Any help would be appreciated!
Jiwa Version 6.5.12 #HF3