Using ReadRecord on SalesQuoteObject to open existing record

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

Using ReadRecord on SalesQuoteObject to open existing record

Postby hjones » Mon Feb 15, 2010 3:07 pm

Hi,

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
hjones
I'm new here
I'm new here
 
Posts: 1
Joined: Thu Nov 12, 2009 1:14 pm

Re: Using ReadRecord on SalesQuoteObject to open existing re

Postby Mike.Sheen » Thu Feb 18, 2010 4:10 pm

You'll need to instruct the system profile object which XML file you want it to read.

So, after this line in your code
Code: Select all
Set SystemProfile = CreateObject("JiwaSysProfile.clsSysProfile")


Add this one
Code: Select all
SystemProfile.Load(myDatabase.IniFile)


There may be other issues, but of the top off my head that is all I can immediately see.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 2 guests