Jump to content

Grabbing data from Related Parent Record.


devru

This topic is 1243 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi everybody. I am struggling to pull info from a related parent records, for fields that are not ListIDs or FullNames. 

For example i am interested in grabbing the accountNumber for an inventory (itemInvetory) Record. 

I am able to grab the FullName and ListID of the related(parent) account using PCQB_RsGetFirstFieldValue("IncomeAccountRef::IncomeAccountRefAccount::ListID"), but i cannot make it work for other fields from that parent table. What am i doing wrong here? i would like to not have matching tables for these cases, and just be able to pull the info directly in the call. I also looked at the xml response and the info is not in it, so i assume something needs to be done before. Any help is greatly appreciated. 

Link to comment
Share on other sites

Not sure what exactly you mean by "grabbing data" or "pull info".

If you want to display data from a field of a parent record, all you need to do is place the field on the layout. It will show data from the first related record in the parent table - and since it is a parent table, there will be only one related record.

By the same token, If you want to use data from a field of a parent record in a calculation defined in the child table, all you need to do is reference the parent field in the calculation's formula directly - for example, the expression:

Parent::Amount + Amount

will return the sum of the parent amount and the child amount. Again, the reference to the parent field will get data from the first related record in the parent table - and again, there will be only one such record. 

 

Link to comment
Share on other sites

  • Newbies
6 minutes ago, comment said:

Not sure what exactly you mean by "grabbing data" or "pull info".

If you want to display data from a field of a parent record, all you need to do is place the field on the layout. It will show data from the first related record in the parent table - and since it is a parent table, there will be only one related record.

By the same token, If you want to use data from a field of a parent record in a calculation defined in the child table, all you need to do is reference the parent field in the calculation's formula directly - for example, the expression:


Parent::Amount + Amount

will return the sum of the parent amount and the child amount. Again, the reference to the parent field will get data from the first related record in the parent table - and again, there will be only one such record. 

 

I have the impression that we are talking about different things. I posted under the FM Books Connector , a plugin for FM. The issue i am facing is pulling data of a parent record in QuickBooks

Link to comment
Share on other sites

If I'm reading correctly, you're looking at the response from an ItemInventoryQuery. It only shows the ListID and FullName values of the three Accounts relevant to an inventory item: IncomeAccount, COGSAccount, and AssetAccount.

To get the AccountNumber value for any one of them, you'll need to create an AccountQuery request. Use the ListID or FullName value returned by the ItemInventoryQuery.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Link to comment
Share on other sites

  • Newbies
6 minutes ago, comment said:

Oops, sorry.

No worries. Appreciate the eagerness to help though

3 minutes ago, Geoffrey Gerhard said:

If I'm reading correctly, you're looking at the response from an ItemInventoryQuery. It only shows the ListID and FullName values of the three Accounts relevant to an inventory item: IncomeAccount, COGSAccount, and AssetAccount.

To get the AccountNumber value for any one of them, you'll need to create an AccountQuery request. Use the ListID or FullName value returned by the ItemInventoryQuery.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105
704.814.6852

Yeah. Was afraid of that. Seems wierd you can records from related childs, but you can't from related parents. Thanks for the help

Link to comment
Share on other sites

This topic is 1243 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.