[GNC] How To Get Job Object?

john jralls at ceridwen.us
Wed Aug 10 21:13:16 EDT 2022


GUIDs belong to the parent class QofInstance, so you use 	qof_instance_get_guid(my_job)

Regards,
John Ralls


> On Aug 10, 2022, at 5:42 PM, Robert Simmons <rsimmons0 at gmail.com> wrote:
> 
> I have created a number of Jobs. Now I want to associate an invoice with
> one of the jobs. I can see there is a function "book.JobLookup()" but the
> argument this takes is GncGUID. I don't know how to create this GUID
> object, and the only way I can see to get the GUID is to just do a SQL
> query directly to the DB.
> 
> The other way that I have found to get to those job objects is to go from a
> customer to the associated jobs using cust.GetJoblist(). This does return a
> list of objects "<Swig Object of type 'GncJob *' at 0x7fd8ccd2bb40>".
> Looking at the object's directory, there are not the expected methods for
> showing the Job name or other attributes:
> 
> ['__class__',
> '__delattr__',
> '__dir__',
> '__doc__',
> '__eq__',
> '__format__',
> '__ge__',
> '__getattribute__',
> '__gt__',
> '__hash__',
> '__init__',
> '__init_subclass__',
> '__int__',
> '__le__',
> '__lt__',
> '__ne__',
> '__new__',
> '__reduce__',
> '__reduce_ex__',
> '__repr__',
> '__setattr__',
> '__sizeof__',
> '__str__',
> '__subclasshook__',
> 'acquire',
> 'append',
> 'disown',
> 'next',
> 'own']
> 
> Can someone point out how to either make a GncGUID object or to get from
> those GniJob objects to the job name?
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list