Productive Computing, Inc. Support Forum

Plug-ins => FM Books Connector => Topic started by: raweeus on January 16, 2013, 03:04:06 PM

Title: view item in QB (for PurchaseOrder)
Post by: raweeus on January 16, 2013, 03:04:06 PM
From Demo script of Invoice

===========================================================================
Perform Script [ “Plug-in Checker” ]
Set Variable [ $$Result ; Value:PCQB_BeginSession(Main::gQB File Name;"") ] Perform Script [ “Check for Errors” ; Parameter: "Pull" ]
If [ Get(ScriptParameter) = "Invoice Pull" ]
#View Invoices (Request)
Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "Invoice" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Inv Pull::TxnID) &
PCQB_RqExecute ]
Else If [ Get( ScriptParameter) = "Invoice Push" ]
#View Invoice Pushed to QB
Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "Invoice" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Main::gPush_Invoice TxnID ) &
PCQB_RqExecute ]
Else If [ Get( ScriptParameter) = "Rec Payment Pull" ]
#View Rec Payments (Request)
Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "ReceivePayment" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Payments Pull::TxnID) & PCQB_RqExecute ]
End If
#Check for Errors
Perform Script [ “Check for Errors” ; Parameter: "Pull" ] Set Variable [ $$Result ; Value:PCQB_EndSession ]
===========================================================================

How do change to make it able to open PurchaseOrder in QB?

I believe it has to do with this line:

Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "Invoice" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Inv Pull::TxnID) & PCQB_RqExecute ]

after I changed to

Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "PurchaseOrder" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Inv Pull::TxnID) & PCQB_RqExecute ]

I could make the scrip to be able to open PurchaseOrder but it can't go to the right "P.O. No."
Title: Re: view item in QB (for PurchaseOrder)
Post by: Geoffrey Gerhard on January 16, 2013, 05:31:29 PM
The problem is probably here...

& PCQB_RqAddFieldWithValue( "TxnID" ; Inv Pull::TxnID)

...unless the value of Inv Pull::TxnID is somehow correct in this context.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
Title: Re: view item in QB (for PurchaseOrder)
Post by: raweeus on January 17, 2013, 08:42:03 AM
Let say I want gPush_Invoice RefNumber to be shown in QB. Can I change to


#View Invoices (Request)
Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "Invoice" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Main::gPush_Invoice RefNumber) &
PCQB_RqExecute ]
Else If [ Get( ScriptParameter) = "Invoice Push" ]

#View Invoice Pushed to QB
Set Variable [ $$Result ; Value:PCQB_RqNew( "TxnDisplayMod"; "" ) & PCQB_RqAddFieldWithValue( "TxnDisplayModType" ; "Invoice" ) & PCQB_RqAddFieldWithValue( "TxnID" ; Main::gPush_Invoice RefNumber ) &
PCQB_RqExecute ]
Else If [ Get( ScriptParameter) = "Rec Payment Pull" ]
Title: Re: view item in QB (for PurchaseOrder)
Post by: Geoffrey Gerhard on January 17, 2013, 12:43:08 PM
If the value of Main::gPush_Invoice RefNumber matches a QB Invoice's TxnID it will display that Invoice. You cannot pass an Invoice's RefNumber and expect it to work.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852