Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6140 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have two Tables in the same database.

When someone prints I want to increment the number held in the users record in table 2.

It seems simple but I cannot seem to achieve this...

Example

someone prints from Table 1

I have tried to set a variable $$print to the value of the field in table 2

then I have tried various means to advance that number I have tried set Next Serial Value... Somehow that does not work... Even a calculated result does not work I must be missing something....

Posted

Things to consider...

1. Is the target field editable. Bear in mind you can set fields to be non-modify after initial value.

2. Do the privileges permit editing.

3. Turn on your script de-bugger and also monitor the variable and target field

4. How long have you been running FMS 9 on Leopard - there are known problems and FMI have not yet released a supported FMS for Leopard.

5. SetNextSerialValue will NOT work for the variable. Just use $$var = $$var + 1

Posted (edited)

You have 80-some posts and you respond with, "It doesn't work?"

Your original post doesn't give enough information to work with; your responses are too slim with information, what is this? You've been around enough here on Forums to know you must be more concise and put a bit of effort into describing both your problem and then what you did which didn't work. :tongue2:

UPDATE: "I have tried to set a variable $$print to the value of the field in table 2"

What value? Where are you when you attempt to grab that value in table 2? What is table 2? Cough up some information!

Edited by Guest
Added update
Posted

The posts say "it does not work" because I am posting here asking for advice, if I knew my way around filemaker I would not ask.

When something does work I usually post a detailed description of how it works and what I did.. Just for others to see how it might be done.

I am sorry if I am annoying you I certainly did not intend to.

I have worked with filemaker for about 8 years very much on the outside, but recently took on a large project, and actually I am finding it very easy compared to say SQL + HTML/ PHP which is like some form of torture in comparison, however I am not completely without ability and have built a number of SQL solutions that are very robust.

Thanks.

Posted (edited)

"The posts say "it does not work" because I am posting here asking for advice, if I knew my way around filemaker I would not ask."

I am not annoyed but I can't imagine how you expect us to do anything more than guess. You need to post saying what you have tried and ... again ... I ask what value you are attempting to grab from table 2. You cannot grab a value from (nor set a value to) table 2 if you are in table 1 and they are not related (or the value isn't global).

It would help to see the script in which you are trying to do this, no? We still can't tell you what might work unless we know the perspective and more details about what you have and what you've tried!!

Edited by Guest
Added "or unless value is global"
Posted

OK, Sorry I got that wrong,

I will try to be clearer in future, I only have Filemaker 9 not advanced so any script steps I think I cannot copy or export to show here, some of the scripts are quite long.

So Thank you for the advice and I will try to be clearer...

Posted

For starters, just tell us:

what the field is you're trying to set (type, and whether or not it's a global)

How you're trying to set it (Set Field, Insert Calculated Result, Paste etc)

How you're getting the value you're setting it to (How you're loading the $$Print value.

Since you're not on Advanced, one debugging trick worth learning is using Show Custom Dialog in your scripts in the problematic areas. For example, adding one right after your Set Variable:

Set Variable [$$Print; theThingIWantToSetThisTo]

Show Custom Dialog [$$Print]

That way you can see whether or not $$Print is loading correctly in the first place.

Posted

For starters, just tell us:

what the field is you're trying to set (type, and whether or not it's a global)

It's a numerical field set at the moment to auto increment using the serial number radio button in the field setup

How you're trying to set it (Set Field, Insert Calculated Result, Paste etc)

I have tried most things...

How you're getting the value you're setting it to (How you're loading the $$Print value.

Since you're not on Advanced, one debugging trick worth learning is using Show Custom Dialog in your scripts in the problematic areas. For example, adding one right after your Set Variable:

The above two answered together...

The value is in another table in the same database...

So I tried your custom dialogue trich and it returns nothing which means the value is not being accessed I guess.

so I tried to et the value of the field like this...

Set Variable[$email; Value:UserRecords2::emails]

Show Custom Dialogue[$email]

the rest of the script tries to increment the value of the field thus...

Set Next Serial Value[userRecords2::emails; (UserRecords2::emails +1)]

A value is returned in the custom Dialogue, but it is not incrementing, I am using FM9 on leopard...

So thanks for the tip that will allow me to troubleshoot much better than before....

So in short a value is returned but I am not having luck in incrementing it

I will try some other methods to increment the number....

Posted (edited)

SetNextSerialValue only sets the next serial value to apply in the Field Definition. It doesn't touch existing data.

You'll want to use SerialIncrement or as suggested earlier Set Field[fieldname; $value +1]...

As for the value not being accessed, I suspect you're not in a context where the data is accessible at the time you're setting the variable. Try navigating to a layout that's tied to the TO before setting the variable, or confirming that there's a valid relationship that'll display the related data - toss the field you're trying to get data from onto the current layout and see if you see any data.

Edited by Guest
Posted

Hi redballoon,

If all these recommendations from experts do not have any good result, how about if you strip out all the data on your solution and give us the sample of your problem that you need help.

Maybe it will help the experts to solve your problem better...

Posted

give us the sample of your problem that you need help

Just be aware, that when asking this way, are you likely to receive a problem which in no way is encapsulated and where things are labeled misleading or directly wrong. You won't be abel to spit for home knitted ways of approaching the relations graph the OP would have no method to untangle the mess, thats why they ask.

There is apparently an omnipresent feeling of a nearly accomplished project felt by most novices with filemaker due to the flatness of the learningcurve as it have seemed until now.

A notion suggesting that the solution only needs a few tricks here and there. It's considered somewhat 90% accomplished only requirering a gifted persons final touch and intervention - no matter how poorly the entire thing is approached.

When Hernandez in his "...Mere Mortals" says never ever use anything of the legacy base, is because you would never be able to see right thru all implications of matters found, when developers are less than accomplished in skills, do they have very little idea of when they have broken normalization rules, and further more have no idea of when it's alright to do so.

The basic error is to think, since it has to do with computers must everything be done on computers as well to earn proper legitimity ... we call it the gucci-approach, the tennis-racket lie or the portastudio lie (refering to the small 4 track casette recorders every aspirering musician dared not to buy years ago) around here. It's not the tools that matters but the methods and the applied knowledge.

There are hardly any tricks worth considering, when proper methods havn't been established yet!

--sd

Posted

Hi Søren,

Just be aware, that when asking this way, are you likely to receive a problem which in no way is encapsulated and where things are labeled misleading or directly wrong.

Thank you for your input and advice.. :)

This topic is 6140 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.