I have used the combination of ExecuteSQL and ValueCount quite a few times throughout my databases before, with almost no issues. Generally what I will do is set a variable by running an ExecuteSQL, then take a ValueCount of that variable. Then with that ValueCount I will loop through my original ExecuteSQL variable.
However, I am now trying to do something different with this combination. Instead of using the ValueCount variable for a loop, I'm trying to use it as a Global Variable that will be displayed on the main menu. Here is an example of the code I'm trying to use:
Set Variable [$source; Value: ExecuteSQL ( "SELECT UUID FROM Inspections WHERE Inspector = ? AND Accepted ≠ Accepted" ; "" ; "" ; $$fullName )] Set Variable [$$accepted; Value: ValueCount ( $source )] The UUID field is, as expected, an auto-entered "Get ( UUID )" field. The Inspection table is a table containing all of our part inspections. Each inspection begins with it's Accepted field having a value of "Rejected", if the correct parameters are met this field will become "Accepted". The Inspector field contains the first and last name of whomever conducted the part inspection. The $$fullName variable is set previously in this same script by comparing the user's Username to a Table that contains all of our user's Usernames and Full Names.
What I was hoping to do is use a Merge Variable on our main menu that displays our $$accepted variable, showing the user how many unaccepted inspections from that particular user in our database.
However, it only ever displays a value of "1". One of our users has 6 unaccepted inspections in our database currently, but this script only shows that he has 1.
I am wondering if you can't use Merge Variables or ExecuteSQL in this way, or if I'm simply missing something obvious.
Please let me know of any more information I should provide. Thank you for any assistance you may offer!
for some reason my portal field has stopped showing the scroll bar and will not create new records, but alters the last record, effectively wiping it out. This is hell on the billing, since these are essentially purchase orders. I have scroll checked in the portal layout box, but no joy. When I invoke the inspector, the appearance and position tabs work fine, but EVERYTHING in the data tab is grayed out and I cannot check the scoll bar function there, or any other box. Adding to the mystery, when I duplicated the layout and replaced the portal with a new one, the scoll bar reappears, but as soon as i revert to Browse mode, the layout goes back to the original, dysfunctional layout and portal and WILL NOT allow me to change to the duplicate layout with the working portal (visible scroll bar) (a new name and everything.) I have named the portal as an object on the original layout and invoke it first with my script. basical open object, go to last line, set several fields, etc. no conditional formatting, just filter for latest seven records and sort ascending. Maybe I have to call it something else on the duplicate?
FMA 11, OSX 11.6. Files too big to post. Menu set to standard.
By David McQueen
Finally getting a chance to play with fmp12.
in Inspector, position, I used to have the choice of inches, centimeters or pixels. In fmp12 the default choices are inches, centimeters and what I assume are points.
Are pixels gone?
I am guessing they probably are because of retina displays doubling up on the resolution, but I would like to know for sure.
Who Viewed the Topic1 member has viewed this topic:Tiger2017