FM 8.03:
I wrote a startup script that uses the Get(PrivilegeSetName) function.
The IF script statements would not work, kept failing the tests.
Oddly, I finally got it to work in this way: I call the script from a
one-line startup script. Then it works fine. But if I move it back to the
on-file perform script slot, it fails.
Why?
|
|
0
|
|
|
|
Reply
|
David
|
4/28/2006 5:53:36 AM |
|
Was this working properly in FM 8.0v2? If so, can you post the entire
If[] statement?
David Robins, MD wrote:
> FM 8.03:
>
> I wrote a startup script that uses the Get(PrivilegeSetName) function.
>
> The IF script statements would not work, kept failing the tests.
>
> Oddly, I finally got it to work in this way: I call the script from a
> one-line startup script. Then it works fine. But if I move it back to the
> on-file perform script slot, it fails.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Professional Solutions, Inc. Los Angeles
FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
4/28/2006 4:43:44 PM
|
|
On 4/28/06 9:43 AM, in article 1254hi5i8l304fc@corp.supernews.com, "Howard
Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
> Was this working properly in FM 8.0v2? If so, can you post the entire
> If[] statement?
>
> David Robins, MD wrote:
>> FM 8.03:
>>
>> I wrote a startup script that uses the Get(PrivilegeSetName) function.
>>
>> The IF script statements would not work, kept failing the tests.
>>
>> Oddly, I finally got it to work in this way: I call the script from a
>> one-line startup script. Then it works fine. But if I move it back to the
>> on-file perform script slot, it fails.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg (818) 883-2846
> FM Professional Solutions, Inc. Los Angeles
>
> FileMaker 8 Certified Developer
> Associate Member, FileMaker Solutions Alliance
No, it did not work in 8.02 either. I updated because something in the
update info mention the Get(PrivilegeSetName) being fixed, and I had hoped
it was that.
The Data_Viewer always showed the correct result from the Get() call.
This is the script I set as the startup script:
-----------------------
If [Get(PrivilegeSetName)="Security Administrator"]
Go to Layout [xxxxx]
Else If [Get(PrivilegeSetName)="New pt entry"]
Go to Layout [xxxxxx]
Else If [Get(PrivilegeSetName)="Data Entry"]
Go to Layout [xxxxx]
Else
Go to Layout [xxxxxx]
End If
--------------------
But it only worked if I did this:
In startup script:
Perform Script [the above script]
|
|
0
|
|
|
|
Reply
|
David
|
4/29/2006 6:07:35 AM
|
|
Any chance that the script that is not working has the option to run
with fill privileges marked? If so, then the get(privilegesetname)
function will return "[Full Access]" while the script is running.
That's probably why it looks okay in the data viewer (while the script
is not running) and in your new single script file.
In my mind, this is undesirable behavior, but it was intentionally
designed that way. Best thing you might do is set a $$GlobalVariable
upon start-up from a script (or subscript of that opening script) that
is not run with full access, and then use that variable when needed.
David Robins, MD wrote:
> On 4/28/06 9:43 AM, in article 1254hi5i8l304fc@corp.supernews.com, "Howard
> Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
>
>> Was this working properly in FM 8.0v2? If so, can you post the entire
>> If[] statement?
>>
>> David Robins, MD wrote:
>>> FM 8.03:
>>>
>>> I wrote a startup script that uses the Get(PrivilegeSetName) function.
>>>
>>> The IF script statements would not work, kept failing the tests.
>>>
>>> Oddly, I finally got it to work in this way: I call the script from a
>>> one-line startup script. Then it works fine. But if I move it back to the
>>> on-file perform script slot, it fails.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Howard Schlossberg (818) 883-2846
>> FM Professional Solutions, Inc. Los Angeles
>>
>> FileMaker 8 Certified Developer
>> Associate Member, FileMaker Solutions Alliance
>
>
> No, it did not work in 8.02 either. I updated because something in the
> update info mention the Get(PrivilegeSetName) being fixed, and I had hoped
> it was that.
>
> The Data_Viewer always showed the correct result from the Get() call.
>
> This is the script I set as the startup script:
>
> -----------------------
> If [Get(PrivilegeSetName)="Security Administrator"]
> Go to Layout [xxxxx]
>
> Else If [Get(PrivilegeSetName)="New pt entry"]
> Go to Layout [xxxxxx]
>
> Else If [Get(PrivilegeSetName)="Data Entry"]
> Go to Layout [xxxxx]
>
> Else
> Go to Layout [xxxxxx]
>
> End If
> --------------------
>
> But it only worked if I did this:
>
> In startup script:
> Perform Script [the above script]
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Professional Solutions, Inc. Los Angeles
FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
4/29/2006 6:26:44 AM
|
|
YES!. The startup script originally had checked "Run script with full access
privileges". When I re-wrote it as a separate script, I did not check "full
access", which is why it ran OK as the "second script". When I go back and
do check-off "run with full access", it fails, just like the original one
did when running as the "startup". So, I left it unchecked, and moved it
back into the startup script itself, and it runs fine!
As you said, this is undesirable (ie. Strange and unexpected) behavior. It
is not mentioned anywhere, and I would have never expected nor suspected
this as the problem.
THANK YOU VERY MUCH, HOWARD. I am in your debt. But, how did you know about
this? Does FileMaker let you in on it, or did you discover it by accident,
or read about it somewhere? Or, do you know by experience, having done this
as a professional developer, which I, of course, am not. I mean, I spent
hours working on this and THOUGHT I had found a workaround, only to find out
now that the only reason it worked at all was I forgot to check-off "full
access" by accident.
-David
On 4/28/06 11:26 PM, in article 12561p9thi84ceb@corp.supernews.com, "Howard
Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
> Any chance that the script that is not working has the option to run
> with fill privileges marked? If so, then the get(privilegesetname)
> function will return "[Full Access]" while the script is running.
> That's probably why it looks okay in the data viewer (while the script
> is not running) and in your new single script file.
>
> In my mind, this is undesirable behavior, but it was intentionally
> designed that way. Best thing you might do is set a $$GlobalVariable
> upon start-up from a script (or subscript of that opening script) that
> is not run with full access, and then use that variable when needed.
>
>
> David Robins, MD wrote:
>> On 4/28/06 9:43 AM, in article 1254hi5i8l304fc@corp.supernews.com, "Howard
>> Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
>>
>>> Was this working properly in FM 8.0v2? If so, can you post the entire
>>> If[] statement?
>>>
>>> David Robins, MD wrote:
>>>> FM 8.03:
>>>>
>>>> I wrote a startup script that uses the Get(PrivilegeSetName) function.
>>>>
>>>> The IF script statements would not work, kept failing the tests.
>>>>
>>>> Oddly, I finally got it to work in this way: I call the script from a
>>>> one-line startup script. Then it works fine. But if I move it back to the
>>>> on-file perform script slot, it fails.
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> Howard Schlossberg (818) 883-2846
>>> FM Professional Solutions, Inc. Los Angeles
>>>
>>> FileMaker 8 Certified Developer
>>> Associate Member, FileMaker Solutions Alliance
>>
>>
>> No, it did not work in 8.02 either. I updated because something in the
>> update info mention the Get(PrivilegeSetName) being fixed, and I had hoped
>> it was that.
>>
>> The Data_Viewer always showed the correct result from the Get() call.
>>
>> This is the script I set as the startup script:
>>
>> -----------------------
>> If [Get(PrivilegeSetName)="Security Administrator"]
>> Go to Layout [xxxxx]
>>
>> Else If [Get(PrivilegeSetName)="New pt entry"]
>> Go to Layout [xxxxxx]
>>
>> Else If [Get(PrivilegeSetName)="Data Entry"]
>> Go to Layout [xxxxx]
>>
>> Else
>> Go to Layout [xxxxxx]
>>
>> End If
>> --------------------
>>
>> But it only worked if I did this:
>>
>> In startup script:
>> Perform Script [the above script]
>>
|
|
0
|
|
|
|
Reply
|
David
|
4/30/2006 3:52:19 AM
|
|
I have come across this myself in similarly frustrating fashion. And
then I have seen it confirmed by other developers on other forums (like
the FSA forum).
David Robins, MD wrote:
> YES!. The startup script originally had checked "Run script with full access
> privileges". When I re-wrote it as a separate script, I did not check "full
> access", which is why it ran OK as the "second script". When I go back and
> do check-off "run with full access", it fails, just like the original one
> did when running as the "startup". So, I left it unchecked, and moved it
> back into the startup script itself, and it runs fine!
>
> As you said, this is undesirable (ie. Strange and unexpected) behavior. It
> is not mentioned anywhere, and I would have never expected nor suspected
> this as the problem.
>
> THANK YOU VERY MUCH, HOWARD. I am in your debt. But, how did you know about
> this? Does FileMaker let you in on it, or did you discover it by accident,
> or read about it somewhere? Or, do you know by experience, having done this
> as a professional developer, which I, of course, am not. I mean, I spent
> hours working on this and THOUGHT I had found a workaround, only to find out
> now that the only reason it worked at all was I forgot to check-off "full
> access" by accident.
>
> -David
>
>
> On 4/28/06 11:26 PM, in article 12561p9thi84ceb@corp.supernews.com, "Howard
> Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
>
>> Any chance that the script that is not working has the option to run
>> with fill privileges marked? If so, then the get(privilegesetname)
>> function will return "[Full Access]" while the script is running.
>> That's probably why it looks okay in the data viewer (while the script
>> is not running) and in your new single script file.
>>
>> In my mind, this is undesirable behavior, but it was intentionally
>> designed that way. Best thing you might do is set a $$GlobalVariable
>> upon start-up from a script (or subscript of that opening script) that
>> is not run with full access, and then use that variable when needed.
>>
>>
>> David Robins, MD wrote:
>>> On 4/28/06 9:43 AM, in article 1254hi5i8l304fc@corp.supernews.com, "Howard
>>> Schlossberg" <howard@antispahm.fmprosolutions.com> wrote:
>>>
>>>> Was this working properly in FM 8.0v2? If so, can you post the entire
>>>> If[] statement?
>>>>
>>>> David Robins, MD wrote:
>>>>> FM 8.03:
>>>>>
>>>>> I wrote a startup script that uses the Get(PrivilegeSetName) function.
>>>>>
>>>>> The IF script statements would not work, kept failing the tests.
>>>>>
>>>>> Oddly, I finally got it to work in this way: I call the script from a
>>>>> one-line startup script. Then it works fine. But if I move it back to the
>>>>> on-file perform script slot, it fails.
>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> Howard Schlossberg (818) 883-2846
>>>> FM Professional Solutions, Inc. Los Angeles
>>>>
>>>> FileMaker 8 Certified Developer
>>>> Associate Member, FileMaker Solutions Alliance
>>>
>>> No, it did not work in 8.02 either. I updated because something in the
>>> update info mention the Get(PrivilegeSetName) being fixed, and I had hoped
>>> it was that.
>>>
>>> The Data_Viewer always showed the correct result from the Get() call.
>>>
>>> This is the script I set as the startup script:
>>>
>>> -----------------------
>>> If [Get(PrivilegeSetName)="Security Administrator"]
>>> Go to Layout [xxxxx]
>>>
>>> Else If [Get(PrivilegeSetName)="New pt entry"]
>>> Go to Layout [xxxxxx]
>>>
>>> Else If [Get(PrivilegeSetName)="Data Entry"]
>>> Go to Layout [xxxxx]
>>>
>>> Else
>>> Go to Layout [xxxxxx]
>>>
>>> End If
>>> --------------------
>>>
>>> But it only worked if I did this:
>>>
>>> In startup script:
>>> Perform Script [the above script]
>>>
>
>
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Professional Solutions, Inc. Los Angeles
FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
4/30/2006 6:29:27 AM
|
|
|
5 Replies
168 Views
(page loaded in 0.093 seconds)
|