October 4, 20214 yr 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
October 4, 20214 yr 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
October 4, 20214 yr Author 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
October 4, 20214 yr 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
October 5, 20214 yr Author 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
Create an account or sign in to comment