Can"t set, goto, or point to a field based on a variable or

Can"t set, goto, or point to a field based on a variable or

am 31.01.2008 23:20:08 von ed.trumpexpo

Hello,

I would like to think that I am at least an intermediate Filemaker
user... I've run into one problem at the result of solving another.

I realize FM Pro 8 is by no means a product life cycle management
tool, but so far what I have designed is sufficient for the client's
needs in light of no PLM. Now I'm getting stuck, though.

I am trying to make a sort of "history" tracking to keep users and
times accountable for updating records. Any user can hit a button when
they decide "this project step is complete," and then anyone can then
later see who made that call and when. My method seems less graceful
to me than it should, but it appears to suffice. I use a repetitive
script and a repeating field to maintain 10 steps of "history." Script
as follows:

Set Field [ Projects::test[10]; Projects::test[9] ]
Set Field [ Projects::test[9]; Projects::test[8] ]
Set Field [ Projects::test[8]; Projects::test[7] ]
Set Field [ Projects::test[7]; Projects::test[6] ]
Set Field [ Projects::test[6]; Projects::test[5] ]
Set Field [ Projects::test[5]; Projects::test[4] ]
Set Field [ Projects::test[4]; Projects::test[3] ]
Set Field [ Projects::test[3]; Projects::test[2] ]
Set Field [ Projects::test[2]; Projects::test[1] ]
Set Field [ Projects::test; Get (CurrentHostTimeStamp) ]
Set Field [ Projects::test name[10]; Projects::test name[9] ]
Set Field [ Projects::test name[9]; Projects::test name[8] ]
Set Field [ Projects::test name[8]; Projects::test name[7] ]
Set Field [ Projects::test name[7]; Projects::test name[6] ]
Set Field [ Projects::test name[6]; Projects::test name[5] ]
Set Field [ Projects::test name[5]; Projects::test name[4] ]
Set Field [ Projects::test name[4]; Projects::test name[3] ]
Set Field [ Projects::test name[3]; Projects::test name[2] ]
Set Field [ Projects::test name[2]; Projects::test name[1] ]
Set Field [ Projects::test name; Get (AccountName) ]

The problem is that there are dozens of project "steps" that users
will need this button/script for. Making this script work with another
field requires changing the target field and calculated result one at
a time for all 20 lines in the script. I can't handle the tedium of
doing that for several dozen scripts!

I cannot, for the life of me, find a way to use one script.
I can set the parameter based on what button instance activates the
script to FieldA for example, but I cannot use the
Get(ScriptParameter) function in the target field setting. Initially I
was trying to set a variable based on what button was clicked, but
even then there seems to be no way to GoTo or Set any field called by
that variable!

Can anyone help me from having to rewrite this same script several
dozen times? Am I being totally ignorant? I haven't be able to find
any solutions searching user groups for days...

Also, if anyone has criticism or alternate suggestions for my method
of tracking event history, feel free.

Thank you very much!!

Ed Perplexedthatthisshouldbesohard

Re: Can"t set, goto, or point to a field based on a variable or parameter.

am 31.01.2008 23:53:36 von ursus.kirk

You can set the field repetition by calculation

Something like this (untested, but should work)

Set variable [ $rep ; 10 ]
Loop
Set Field [ projects::test[$Rep]; Projects::test[$rep - 1] ]
Set variable [ $Rep ; $Rep - 1 ]
Exit Loop If [ $Rep = 1 ]
End loop

But I would use a completely different approach:

Where the test field resides in its own table.
I would store the timestamp of the change as well, together with the ID from
the related record.
Then show all related changes in a portal sorted on timestamp.
No limits on how many changes there are, easy to maintain

Keep well, Ursus

schreef in bericht
news:882687d4-0d3b-4845-a7e2-0a0639978910@v17g2000hsa.google groups.com...
> Hello,
>
> I would like to think that I am at least an intermediate Filemaker
> user... I've run into one problem at the result of solving another.
>
> I realize FM Pro 8 is by no means a product life cycle management
> tool, but so far what I have designed is sufficient for the client's
> needs in light of no PLM. Now I'm getting stuck, though.
>
> I am trying to make a sort of "history" tracking to keep users and
> times accountable for updating records. Any user can hit a button when
> they decide "this project step is complete," and then anyone can then
> later see who made that call and when. My method seems less graceful
> to me than it should, but it appears to suffice. I use a repetitive
> script and a repeating field to maintain 10 steps of "history." Script
> as follows:
>
> Set Field [ Projects::test[10]; Projects::test[9] ]
> Set Field [ Projects::test[9]; Projects::test[8] ]
> Set Field [ Projects::test[8]; Projects::test[7] ]
> Set Field [ Projects::test[7]; Projects::test[6] ]
> Set Field [ Projects::test[6]; Projects::test[5] ]
> Set Field [ Projects::test[5]; Projects::test[4] ]
> Set Field [ Projects::test[4]; Projects::test[3] ]
> Set Field [ Projects::test[3]; Projects::test[2] ]
> Set Field [ Projects::test[2]; Projects::test[1] ]
> Set Field [ Projects::test; Get (CurrentHostTimeStamp) ]
> Set Field [ Projects::test name[10]; Projects::test name[9] ]
> Set Field [ Projects::test name[9]; Projects::test name[8] ]
> Set Field [ Projects::test name[8]; Projects::test name[7] ]
> Set Field [ Projects::test name[7]; Projects::test name[6] ]
> Set Field [ Projects::test name[6]; Projects::test name[5] ]
> Set Field [ Projects::test name[5]; Projects::test name[4] ]
> Set Field [ Projects::test name[4]; Projects::test name[3] ]
> Set Field [ Projects::test name[3]; Projects::test name[2] ]
> Set Field [ Projects::test name[2]; Projects::test name[1] ]
> Set Field [ Projects::test name; Get (AccountName) ]
>
> The problem is that there are dozens of project "steps" that users
> will need this button/script for. Making this script work with another
> field requires changing the target field and calculated result one at
> a time for all 20 lines in the script. I can't handle the tedium of
> doing that for several dozen scripts!
>
> I cannot, for the life of me, find a way to use one script.
> I can set the parameter based on what button instance activates the
> script to FieldA for example, but I cannot use the
> Get(ScriptParameter) function in the target field setting. Initially I
> was trying to set a variable based on what button was clicked, but
> even then there seems to be no way to GoTo or Set any field called by
> that variable!
>
> Can anyone help me from having to rewrite this same script several
> dozen times? Am I being totally ignorant? I haven't be able to find
> any solutions searching user groups for days...
>
> Also, if anyone has criticism or alternate suggestions for my method
> of tracking event history, feel free.
>
> Thank you very much!!
>
> Ed Perplexedthatthisshouldbesohard

Re: Can"t set, goto, or point to a field based on a variable or

am 01.02.2008 22:39:30 von ed.trumpexpo

On Jan 31, 4:53 pm, "Ursus" wrote:
> You can set the field repetition by calculation
>
> Something like this (untested, but should work)
>
> Set variable [ $rep ; 10 ]
> Loop
> Set Field [ projects::test[$Rep]; Projects::test[$rep - 1] ]
> Set variable [ $Rep ; $Rep - 1 ]
> Exit Loop If [ $Rep = 1 ]
> End loop
>
> But I would use a completely different approach:
>
> Where the test field resides in its own table.
> I would store the timestamp of the change as well, together with the ID from
> the related record.
> Then show all related changes in a portal sorted on timestamp.
> No limits on how many changes there are, easy to maintain
>
> Keep well, Ursus
>

Thank you, Ursus.
Silly me, I forgot about loops! That's nice to shorten the script.
However, I still have the limitation of not being able to set the
field itself by calculation or variable. I would still need to "re-
write" this script for the dozens of "steps" I want it to apply to.

Like you suggest, I had thought about treating these "events" or
"steps" as records in their own table because it makes more sense and
it's cleaner. Yet, I don't believe I can accomplish that in this
situation either. Here is my scenario and logic:

The tables in question are PRODUCTS, PROJECTS and PROJECT
RELATIONSHIPS, each with their own fields. The client wanted to a
multi-multi relation for PRODUCTS and PROJECTS so they could have any
number of products be members of any number of projects. That I did by
placing a portal on the PROJECTS layout showing related records from
PROJECT RELATIONSHIPS. It also has fields from PRODUCTS. This is the
only way I can see to show a list of products that are members on each
project record.
They then want to track the steps of progress for each item in each
project, independent of each other. Okay, seems like that will fit
fine with this setup... I obviously need the step fields in the
relationship table because every step is unique to the product/project
relationship. So, I have these fields for example:

PRODUCTS::ID
PRODUCTS::Image *
PRODUCTS::Serial *
PRODUCTS::Type

PROJECTS::ID
PROJECTS::Name
PROJECTS::Serial
PROJECTS::Duedate

PROJECT RELATIONSHIPS::ID
PROJECT RELATIONSHIPS::PRODUCTSID
PROJECT RELATIONSHIPS::PROJECTSID
PROJECT RELATIONSHIPS::Step1date *
PROJECT RELATIONSHIPS::Step1name *
PROJECT RELATIONSHIPS::Step2date ... etc. *

On the project layout is the portal set to show related records from
PROJECT RELATIONSHIPS, and it displays the above fields noted with
asterisks.
Clincher:
The reason I think I can't separate the step fields into their own new
table is that I can't place a portal inside a portal.
Ah! But repeating fields will let me display the history of these
steps on each row of the portal. That is what resulted in my intention
to develop the scripts mentioned above, and thus the desire to set
fields by variable.

Maybe I'm more of a novice than I thought... If someone were able to
suggest a way that I could, while looking at a project record on that
layout, see a list of related products with a list of step history on
each of those listed products, than I would happy to let my brain melt
trying to relate a separate step table to my relationships table. Keep
in mind the user also needs to be able to "complete" those steps from
this view as well with a button/script.
Where's Helpful Harry when I need him? ;-)

Thank you anyone for insights!!

Ed