Author Topic: Pushing a Build Assembly  (Read 5840 times)

jnate

  • Member
  • *
  • Posts: 4
Pushing a Build Assembly
« on: July 21, 2009, 11:39:46 AM »
Greetings;

I'm attempting to modify Build Assemblies in the Quick Books database.  I have added a new table with 4 entries:

gPush_Build_TxnDate
gPush_Build_FullName
gPush_Build_QuantityToBuild
gPush_Build_RefNumber

Next I built a new Layout including these four items.

Finally, I constructed the following script:

Set Error Capture [On}
Allow User Abort [On}
Set Field {Main::gResult; PCQB_RqNew("BuildAssemblyAddRef")
Set Field {Main::gResult; PCQB_RqAddFieldWithValue( "ItemInventoryAssemblyRef::FullName" ; Build Assemblies Push::gPush_Build_FullName )]
Set Field {Main::gResult; PCQB_RqAddFieldWithValue( "TxnDate" ; Build Assemblies Push::gPush_Build_TxnDate )]
Set Field {Main::gResult; PCQB_RqAddFieldWithValue( "RefNumber" ; Build Assemblies Push::gPush_Build_RefNumber )]
Set Field {Main::gResult; PCQB_RqAddFieldWithValue( "QuantityToBuild" ; Build Assemblies Push::gPush_Build_QuantityToBuild )]
Set Field {Main::gResult; PCQB_BeginSession ("";"")
Set Field {Main::gResult; PCQB_RqExecute
Set Field {Main::gResult; PCQB_EndSession

All appears well except, of course, for the fact that when I execute the script nothing happens in QuickBooks and I recieve no error message in Filemaker Pro.

Any Idea what I might have done wrong?  It's a simple script so I'm assuming it's something simple that I messed up.

Thanks in advance for any help and insight.

John Nate

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Pushing a Build Assembly
« Reply #1 on: July 21, 2009, 01:02:38 PM »
Please replace PCQB_RqNew("BuildAssemblyAddRef") with PCQB_RqNew("BuildAssemblyAdd") as according to the OSR there should not be a "Ref" on the end.  :o

jnate

  • Member
  • *
  • Posts: 4
Re: Pushing a Build Assembly
« Reply #2 on: July 21, 2009, 01:59:50 PM »
Hi Melinda;

Thanks for the response.  Actually, I had tried both versions (BuildAssemblyAddRef and BuildAssemblyAdd thinking that might be the problem) with the same results.  Nothing updated in QB.

Anything else that might be wrong?

Thanks,
John Nate

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Pushing a Build Assembly
« Reply #3 on: July 21, 2009, 03:18:17 PM »
Can you please do some additional error trapping by opening "Script Debugger", "Data Viewer" and walking through each script step to see what is returned. If an !!ERROR!! string is returned then please immediately call PCQB_SGetStatus to obtain a full description of the error. Please let me know.

jnate

  • Member
  • *
  • Posts: 4
Re: Pushing a Build Assembly
« Reply #4 on: July 21, 2009, 06:09:46 PM »
Unfortunately we are on the Standard version of FMP 8 and only the Advanced version has the Debugger.  I could probably download the latest trial version but would testing in 10 to see if this will work in 8 be a valid test?  Do you have any other options?

John Nate

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Pushing a Build Assembly
« Reply #5 on: July 22, 2009, 09:45:59 AM »
If you do not have access to FileMaker Advanced then please add error trapping in your script by calling PCQB_SGetStatus if !!ERROR!! or ? are returned directly after the BeginSession and Execute functions.

Please let me know what errors are returned.

jnate

  • Member
  • *
  • Posts: 4
Re: Pushing a Build Assembly
« Reply #6 on: July 22, 2009, 11:43:04 AM »
The Advanced version is not available for download on the Filemaker site, only the standard version and Server.  The site doesn't state if Script Debugger is a feature of Server.  Do you know if it is?

Thanks,
John Nate

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Pushing a Build Assembly
« Reply #7 on: July 22, 2009, 02:51:37 PM »
ScriptDebugger is only on FileMaker Pro Advanced. Since you do not have access to FileMaker Pro Advanced, then please add error trapping in your scripts. Directly after the BeginSession and RqExecute functions, call SGetStatus IF the result does not equal 0.

Please let me know what error text is returned.

Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: Pushing a Build Assembly
« Reply #8 on: July 27, 2009, 12:54:28 PM »
After adding the additional error trapping mentioned above, the following error was received:

CODE: 3140
SEVERITY: Error
MESSAGE: There is an invalid reference to QuickBooks ItemInventoryAssembly "Converting-Test" in the BuildAssembly.  QuickBooks error message: Invalid argument.  The specified record does not exist in the list.

In QuickBooks the "Converting-Test" record does exist as shown in the screen shot. However the issue was that "Converting-Test" is a subitem of "Converted Rolls" and therefore needs to be properly referenced. The screen shot also explains how to properly reference a FullName that has "ancestors." Basically you should reference “Converted Rolls:Converting-Test” as the FullName must be prefixed by the names of each ancestor. 

I confirmed with John that this resloved the issue. Hopefully this response will assist others when developing their FileMaker scripts. Please remember to always add error trapping to your scripts and reference the OSR!