Bruce Herbach Posted October 4, 2021 Posted October 4, 2021 Hi, I'm working on a script to send Client invoices to QuickBooks. In the Demo file the example script is named "Push Invoice to QB(FM16)" The big difference in the scripting appears to be the PCQB_RqAddFieldWithValue script steps. In the non (FM16) scripts these are done in a set variable script step. For most of these the $$Result variable is ignored. In the (FM16) scripts the PCQB_RqAddFieldWithValue is on it's own and not part of a set variable script step. So is the main difference between the example scripts due to an update to the PCQB_RqAddFieldWithValue and other functions so that they return an error code that can be checked? Thanks Bruce Herbach
Geoffrey Gerhard Posted October 4, 2021 Posted October 4, 2021 I can't speak to why the example scripts call the functions differently, but would guess that error checking is easier if you call the function within a Set Variable step. I'd be curious to know what conditions would return a non-zero value for that function call. Would it return a 1 or "!!ERROR!!" if the value you pass violates the length constraint of the specified element? Would it if you tried adding an element in the wrong sequence—ClassRef before CustomerRef, for example. I don't know, and have only ever tested for an error in the result of a call to the PCQB_RqAddFieldWithValue function when working in another developer's solution, and then only because that already did so. Perhaps I never ran into an error in my integrations because I evaluate the values and trap for potential errors before making the function call. If you end up testing whether a function returns something other than 0 when you deliberately violate a length constraint or put an element in the wrong place, please post that you did so and what you discovered. Geoffrey Gerhard Creative Solutions Incorporated 14000 Creekside Drive Matthews, NC 28105 704.814.6852
Bruce Herbach Posted October 4, 2021 Author Posted October 4, 2021 Geoffrey, Thanks. If I have a chance to test it I will and will let you know. I was curious as to why someone thought it was important to name the scripts with FM16 in the name. I guessed that they were written in an earlier version, still worked so didn't need an update. A user/developer be ware kind of thing. Bruce Herbach
Geoffrey Gerhard Posted October 4, 2021 Posted October 4, 2021 I believe FM16 is when the ability to call a plug-in function as a script step first appeared, so probably that name was used to help users who opened the file with an earlier version of FMP understand why it was blank (or filled with <function missing> steps.) Geoffrey Gerhard Creative Solutions Incorporated 14000 Creekside Drive Matthews, NC 28105 704.814.6852
Bruce Herbach Posted October 5, 2021 Author Posted October 5, 2021 So prior to FM16, using the function in a Set Variable script step was required, but now I can use it either way. Thanks for the history. Very helpful. Bruce Herbach
Recommended Posts
This topic is 1136 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now