Jump to content
Jim_Shelton

FM Books Connector

Recommended Posts

Jim_Shelton

I have a script, Pull Customers, that works if I have no script steps that contain, BillAddress fields (like BillAddress::City, BillAddress::State and BillAddress::PostalCode).

 

When I pull out each of the steps that include these fields it works.

 

With the script steps in, both FM and QB go to Not Responding. When you exit out of QB, a error displays:

Code: -2147467261

Exceptions

Success

 

Any assistance would be super.

 

Jim

Share this post


Link to post
Share on other sites
Josh Ormond

If you list out the step, verbatim, it is easier to help. Print the script to a PDF, and then copy the text and paste it into your reply.

Share this post


Link to post
Share on other sites
Jim_Shelton

Here is the script. The steps with BillAddress::, such as BillAddress::City, are the problem steps.

 

thanks, Jim

 

 

Set Error Capture [ On] Allow User Abort [ Off ] Freeze Window

#Open Session

 

Set Field [ Account::gResult; PCQB_BeginSession (Account::gQB_FileName;"") ]

 

Perform Script [ “Check for Errors” ]

 

#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 [ Account::gQB_Version; PCQB_GetCurrentFileVersion]

 

#Query Customers in QB (Request)

 

Set Field [ Account::gResult; PCQB_RqNew("CustomerQuery" ; "" )]

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue("ActiveStatus; "All" ) ] If [ GetAsNumberPCQB_GetCurrentFileVersion) >= 14 ]

 

#The area below limits the returned response to the fields listed below.

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ( "IncludeRetElement" ; "ListID" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ( "IncludeRetElement" ; "FullName" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "CompanyName" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ( "IncludeRetElement" ; "FirstName" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "LastName" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "BillAddress::Addr3" ) ]

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ( "IncludeRetElement" ; "BillAddress::Addr4" ) ]

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "BillAddress::City" ) ]

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "BillAddress::State" ) ]

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "BillAddress::PostalCode" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "Phone" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "Email" ) ]

 

Set Field [ Account::gResult; PCQB_RqAddFieldWithValue ("IncludeRetElement" ; "JobName" ) ]

 

End If

#Execute

 

Set Field [ Account::gResult; PCQB_RqExecute]

 

Perform Script [ “Check for Errors” ]

 

#Close Session

 

Set Field [ Account::gResult; PCQB_EndSession]

 

#Create Customers in FileMaker (Response)

 

Set Field [ Account::gResult; PCQB_RsOpenFirstRecord ]

 

Set Field [ Account::gcount; 0 ]

 

Loop

Exit Loop If [ Account::gResult = "!!ERROR!!" or Account::gResult = "End" or Account::gResult = "?" or

 

Account::gcount= 15 ]

 

New Record/Request

Set Field [ Account::gcount; Account::gcount + 1 ]

 

Set Field [ Account::ListID; PCQB_RsGetFirstFieldValue (“ListID") ]

 

Set Field [ Account::Full_Name; PCQB_RsGetFirstFieldValue (“FullName") ]

 

Set Field [ Account::Full_Name; /*// This calculation will find all customers with ":" in the name and format the name as a project.

 

Let(X = Account::Full_Name;

 

Case(PatternCount(X; ":");

" " & Middle(X; Position ( X ; ":" ; 1 ; 1 )+1; 100)

; X)

)*/ ]

 

Set Field [ Account::Company; PCQB_RsGetFirstFieldValue (“CompanyName") ]

 

Set Field [ Account::First_Name; PCQB_RsGetFirstFieldValue (“FirstName") ]

 

Set Field [ Account::Last_Name; PCQB_RsGetFirstFieldValue ("LastName") ]

 

Set Field [ Account::Address; PCQB_RsGetFirstFieldValue ("BillAddress::Addr3") ]

Set Field [ Account::Address2; PCQB_RsGetFirstFieldValue (“BillAddress::Addr4") ]

Set Field [ Account::City; PCQB_RsGetFirstFieldValue (“BillAddress::City") ]

Set Field [ Account::State; PCQB_RsGetFirstFieldValue ("BillAddress::State") ]

 

Set Field [ Account::Zip; PCQB_RsGetFirstFieldValue ("BillAddress::Zip") ]

 

Set Field [ Account::Phone1; PCQB_RsGetFirstFieldValue ("Phone") ]

 

Set Field [ Account::Email; PCQB_RsGetFirstFieldValue ("Email") ]

 

Set Field [ Account::QB_JobName; PCQB_RsGetFirstFieldValue ("JobName") ]

 

Set Field [ Account::gResult; PCQB_RsOpenNextRecord ]

 

End Loop

Set Field [ Account::gResult; PCQB_SGetStatus ]

 

Go to Layout [ original layout ]

Share this post


Link to post
Share on other sites
Techphan

Is this thread still active? Jim Shelton - did you solve this problem?

Share this post


Link to post
Share on other sites
Jack Rodgers

Try setting a variable to each BillAddress field and using that variable instead of the field.

Share this post


Link to post
Share on other sites
Jim_Shelton
Try setting a variable to each BillAddress field and using that variable instead of the field.

 

After a session with Productive Comuting, I learned that a script step was missing. When I can get back into the file, I will post the working script.

 

Jim

Share this post


Link to post
Share on other sites



  • WE NEED YOUR DONATION NOW

    WE have helped 100,000's of people for many years, now we need your help!!!! Your Donation is Needed to Keep Us Online! Covid 19 and isolation!!!! Without Your Help We Are Gone After 23  Years!



    3% of donation goal reached.
    Donate Sidebar by DevFuse
  • Images

×
×
  • Create New...

Important Information

Terms of Use