Author Topic: QB Cust List ID not pulling  (Read 1930 times)

rpaulh

  • Member
  • *
  • Posts: 22
QB Cust List ID not pulling
« on: January 12, 2012, 10:37:28 AM »
Have a script that was working fine and just found out that it is not pulling the List ID from QB to FM. The is an adapted script from the FMBooks demo file. The code just before and after the List Id step is:
Code: [Select]
#Capture the QB List ID and Edit Sequence (Response)
Set Variable [ $$Result; Value:PCQB_RsOpenFirstRecord ]
Set Field [ !Home::QB Cust List ID; PCQB_RsGetFirstFieldValue( "ListID" ) ]
Set Field [ !Home::gPushCustomerFullName; PCQB_RsGetFirstFieldValue( "FullName" ) ]
Set Field [ !Home::gPushCustomerEditSequence; PCQB_RsGetFirstFieldValue( "EditSequence" ) ]

The Edit Sequence is pulling but the List ID and Full Name are not.

I'm having another issue with this script but thought this was first priority since QB does not see that I have already tried to push to it.
Thanks,
Paul

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: QB Cust List ID not pulling
« Reply #1 on: January 12, 2012, 11:03:00 AM »
What kind of Request did you make prior to running the steps seen here? List and Transaction Requests both have an Edit Sequence, but only a List Request could return a ListID and FullName value in the quoted steps. My suspicion is that the prior Request addressed a Transaction.

HTH!

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

rpaulh

  • Member
  • *
  • Posts: 22
Re: QB Cust List ID not pulling
« Reply #2 on: January 13, 2012, 09:45:38 AM »
Geoffrey, as usual you are the first with a response/idea. Because I am not totally understand all the code I cannot see what type of request is being performed. Here is the entire script, as I said it worked without fail before and has not been changed.
Code: [Select]
#Setup
Set Error Capture [ On ]
Allow User Abort [ On ]
Perform Script [ “Check for Browse Mode” ]
Set Variable [ $Tab; Value:Case (GetLayoutObjectAttribut ( "Setup"; "isFrontTabPanel" ) ; "Setup" ;
GetLayoutObjectAttribute ( "Pull"; "isFrontTabPanel" ) and GetLayoutObjectAttribute ("Invoice"; "isFrontTabPanel"); "Invoice" ;
GetLayoutObjectAttribute ( "Pull"; "isFrontTabPanel" ) and GetLayoutObjectAttribute ("Received Payments"; "isFrontTabPanel"); "Received
Payments" ;
GetLayoutObjectAttribute ( "Push"; "isFrontTabPanel" ) ; "Push" ;
GetLayoutObjectAttribute ( "Other"; "isFrontTabPanel" ) ; "Other" ;
) ]
#This will ensure that the plug-in has been registered either as a demo or full version before continuing.
Perform Script [ “Check PlugIn” ]
Freeze Window
#Close Session - This will end any session that may have been started and not properly ended.
Set Field [ !Home::gResult; PCQB_EndSession ]
If [ !Home::gResult ≠ 0 ]
Go to Layout [ original layout ]
Go to Object [ Object Name: $Tab ]
Halt Script
End If
#Prep Customer info (Request)
Go to Layout [ “Data Entry HOME” (!Home) ]
Go to Object [ Object Name: "EnTouch" ]
Set Variable [ $$Result; Value:PCQB_RqNew("CustomerAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Name" ; !Home::Site ID ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ParentRef:FullName" ; !Home::QB CustomerJob Name ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "CompanyName" ; !Home::Company ) ]
// Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Salutation" ; home_ADDRESS ~ Billing Address::Person Type ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "FirstName" ; !Home::First Name ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "MiddleName" ; !Home::Middle Initial ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "LastName" ; !Home::Last Name ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::Addr1" ; home_ADDRESS ~ Billing Address::Company ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::Addr2" ; home_ADDRESS ~ Billing Address::Address 1 ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::Addr3" ; home_ADDRESS ~ Billing Address::Address 2 ) ]
// If [ /*GetAsNumber(Main::gQB_Version) >= 2*/ ]
// Set Variable [ $$Result; Value:/*PCQB_RqAddFieldWithValue( "BillAddress::Addr4" ; Main::gPush_Customer Bill Address Addr4 )*/ ]
// End If
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::City" ; home_ADDRESS ~ Billing Address::City ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::State"; home_ADDRESS ~ Billing Address::State ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "BillAddress::PostalCode" ; home_ADDRESS ~ Billing Address::Zip ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ShipAddress::Addr1" ; home_ADDRESS ~ Site Address::Address 1 ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ShipAddress::Addr2" ; home_ADDRESS ~ Site Address::Address 2 ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ShipAddress::City" ; home_ADDRESS ~ Site Address::City ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ShipAddress::State" ; home_ADDRESS ~ Site Address::State ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ShipAddress::PostalCode" ; home_ADDRESS ~ Site Address::Zip ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Phone" ; home_PHONES ~ ID #::Formated Phone Calc ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Email" ; home_PHONES ~ Email::Formated Phone Calc ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TermsRef::FullName" ; !Home::Terms Calc ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountNumber" ; !Home::Account Number ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "CreditLimit" ; !Home::Credit Limit ) ]
// Set Variable [ $$Result; Value:"/*PCQB_RqAddFieldWithValue( \"Email\" ; Main::gPush_Customer Email )*/" ]
#Open Session
Set Variable [ $$Result; Value:PCQB_BeginSession(!Home::gQBFileName;"") ]
Set Field [ !Home::gCountry; Middle(PCQB_GetCurrentQBVersion; Position(PCQB_GetCurrentQBVersion; "Country: "; 1; 1) + 9; 2) ]
Perform Script [ “Check for Errors-Cust”; Parameter: $Tab ]
Set Field [ !Home::gConnectionStatus; True ]
#Checks and Sets the QuickBooks Version. This allows us to identify a US or International version of QuickBooks based on the QuickBooks file
that is opened.
Set Field [ !Home::gQBVersion; PCQB_GetCurrentFileVersion ]
#Execute
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Perform Script [ “Check for Errors-Cust”; Parameter: $Tab ]
#Close Session
Set Variable [ $$Result; Value:PCQB_EndSession ]
#Get Status
Set Field [ !Home::gResult; PCQB_SGetStatus ]
#Capture the QB List ID and Edit Sequence (Response)
Set Variable [ $$Result; Value:PCQB_RsOpenFirstRecord ]
Set Field [ !Home::QB Cust List ID; PCQB_RsGetFirstFieldValue( "ListID" ) ]
Set Field [ !Home::gPushCustomerFullName; PCQB_RsGetFirstFieldValue( "FullName" ) ]
Set Field [ !Home::gPushCustomerEditSequence; PCQB_RsGetFirstFieldValue( "EditSequence" ) ]
Go to Layout [ “Data Entry HOME” (!Home) ]
Go to Object [ Object Name: "EnTouch" ]
Set Field [ !Home::gAddFlag; "*" ]
Set Field [ !Home::gAddFlagDescription; "* cannot edit field after customer is added" ]
Thank you,
Paul

1/24/12 - Hello is anybody out there with an idea. If I cannot solve this I will have to start again with the demo file and customize it and hope it works. I really do not want to do that. Help!
Paul
« Last Edit: January 24, 2012, 01:48:58 PM by rpaulh »

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: QB Cust List ID not pulling
« Reply #3 on: January 24, 2012, 02:36:57 PM »
Did you ever solve this? If not, insert a Set Field or Set Variable step with this argument:

PCQB_SGetXML( "Response" ; "" )

 right above these steps:

#Capture the QB List ID and Edit Sequence (Response)
Set Variable [ $$Result; Value:PCQB_RsOpenFirstRecord ]
Set Field [ !Home::QB Cust List ID; PCQB_RsGetFirstFieldValue( "ListID" ) ]
Set Field [ !Home::gPushCustomerFullName; PCQB_RsGetFirstFieldValue( "FullName" ) ]
Set Field [ !Home::gPushCustomerEditSequence; PCQB_RsGetFirstFieldValue( "EditSequence" ) ]

and post the xml here.


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