Productive Computing, Inc. Support Forum

Plug-ins => FM Books Connector => Topic started by: mvoogt on June 21, 2010, 03:24:52 PM

Title: Mod Customer field does not change
Post by: mvoogt on June 21, 2010, 03:24:52 PM
I have a small problem when modifying a customer field. If the field has something in it already (lets say the notes field). I cannot seem to modify that field to make it become empty. Here is my modify script:

--------------------------
Set Field [ AVHTOOL Globals::gPush_Customer Company; AVH Customers::Customer Company Name ]
Set Field [ AVHTOOL Globals::gResult; PCQB_EndSession ]
Set Field [ AVHTOOL Globals::gResult; PCQB_BeginSession(AVHTOOL Globals::gQB File Name;"") ]
Set Error Capture [ On ]
Allow User Abort [ On ]
Freeze Window
Go to Layout [ “Customers AVH” (AVH Customers) ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RqNew("CustomerQuery" ; ""  ) ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RqAddFieldWithValue( "FullName" ; AVHTOOL Globals::gPush_Customer Company) ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RqAddFieldWithValue( "IncludeRetElement" ; "EditSequence" ) ]
If [ 0 = PCQB_RqExecute ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RsOpenFirstRecord ]
Set Field [ AVHTOOL Globals::gPush_Customer Edit Sequence; PCQB_RsGetFirstFieldValue( "EditSequence" ) ]
Else
Exit Script [ Result: PCQB_SGetStatus ]
End If
Set Field [ QB Customers::gLayoutNumber; Get(LayoutNumber) ]
Set Field [ QB Customers::gResult; PCQB_EndSession ]
Set Field [ AVHTOOL Globals::gPush_Customer Company; AVH Customers::Customer Company Name ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RqNew("CustomerMod" ; ""  ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ListID";QB Customers::QB List ID ) ]
Set Field [ AVHTOOL Globals::gResult; PCQB_RqAddFieldWithValue( "EditSequence" ; AVHTOOL Globals::gPush_Customer Edit
Sequence ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Name" ; AVH Customers::Customer Company Name ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "CompanyName" ; AVH Customers::Customer Company Name ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::Addr1" ; QB Customers::bill address Company Name ) ]
June 21, 2010 15:21:20 -1- AVHTOOL20 - -Push (Mod) Customer to QBQB Pull Futures: -Push (Mod) Customer to QB
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::Addr2" ; QB Customers::billaddress 1 ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::Addr3" ; QB Customers::billaddress 2 ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::Addr4" ; QB Customers::billaddress 3 ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::City" ; QB Customers::billcity ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::State" ; QB Customers::billstate ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::PostalCode" ; QB Customers::billpostalcode ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "BillAddress::Country" ; QB Customers::billcountry ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::Addr1" ; QB Customers::shipaddressname ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::Addr2" ; QB Customers::shipaddressone ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::Addr3" ; QB Customers::shipaddresstwo ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::Addr4" ; QB Customers::shipaddressthree ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::City" ; QB Customers::shipcity ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::State" ; QB Customers::shipstate ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::PostalCode" ; QB Customers::shippostalcode ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ShipAddress::Country" ; QB Customers::shipcountry ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Phone" ; QB Customers::Phone ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "AltPhone" ; QB Customers::alt phone ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Fax" ; QB Customers::fax ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Email" ; QB Customers::Email ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Contact" ; QB Customers::contact ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "AltContact" ; QB Customers::altcontact ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "TermsRef::FullName" ; QB Customers::terms ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "SalesRepRef::FullName" ; QB Customers::SalesRep ) ]
If [ QB Customers::ItemSalesTaxRef = "CA Resale" ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "SalesTaxCodeRef::FullName" ; "Non" ) ]
End If
If [ QB Customers::ItemSalesTaxRef = "CA Taxable" ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "SalesTaxCodeRef::FullName" ; "Tax" ) ]
End If
If [ QB Customers::ItemSalesTaxRef = "Out of State" ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "SalesTaxCodeRef::FullName" ; "Non" ) ]
End If
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "ItemSalesTaxRef::FullName" ; QB Customers::ItemSalesTaxRef ) ]
Set Field [ QB Customers::gResult; PCQB_RqAddFieldWithValue( "Notes" ; QB Customers::Notes ) ]
Set Field [ QB Customers::gResult; PCQB_RqCloseRelatedRecord ]
Set Field [ QB Customers::gResult; PCQB_BeginSession(QB Customers::gQB File Name;"") ]
Set Field [ QB Customers::gResult; PCQB_RqExecute ]
Set Field [ QB Customers::gResult[2]; PCQB_EndSession ]
Commit Records/Requests
--------------------------

Any reason I should not be able to modify a field to make it blank?
Title: Re: Mod Customer field does not change
Post by: Geoffrey Gerhard on July 08, 2010, 09:50:38 AM
You wrote:

> Any reason I should not be able to modify a field to make it blank?

I can't think of one in the context of your script. You cannot clear a custom field of its data using a Mod operation, but Notes is not a custom field. Are you sure that your field (QB Customers::Notes) is empty? If you have FileMaker Advanced, you might try this (with the target record's ListID and EditSequence values) in your data viewer...

PCQB_RqNew("CustomerMod" ; "" ) &
PCQB_RqAddFieldWithValue( "ListID"; "80000126-1278353755" ) &
PCQB_RqAddFieldWithValue( "EditSequence" ; "1278606485" ) &
PCQB_RqAddFieldWithValue( "Notes" ; "" ) &
PCQB_RqExecute

...and see if that clears it. It works for me using FMBooks Connector 2.0.0.4, QB Enterprise 9, and FMPA 10.