Jump to content
Server Maintenance This Week. ×

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

Recommended Posts

Newbie.

OK, here goes...

• When I make a new entry into a portal, the cursor automatically enters a text field.
• This text field triggers a script. (or whenever I enter it)
• I had hoped that script would set a variable called "$$todo", with the value being the record's Primary Key, which i had thought it would have grabbed with the following script...
        Set Variable [$$todo; Value:GetField ( ToDo_Pk )]
• But I just get a "?"

So in other words, I'm trying to set a variable called "$$todo"... of the record that holds within it a text field I had entered. Obviously there is something wrong with my script, but I haven't got a clue what I'm doing wrong... is there anyone out there who can point me in the right direction?

I tried to embed some images, but it just isn't happening for some reason, all I'm seeing is an endless spinning icon.

 Thanks.
              
 

 

 

Link to comment
Share on other sites

If you are in a portal, no need to use GetField().  Just use the related pk field reference directly (through the relationship)

​Thanks Wim, but its not working.

I guess you mean...

Set Variable [$$todo; Value:ToDo::ToDo_Pk

I've added a merged variable to my layout to see if it is pulling the value as I haven't got 'Filemaker Pro Advanced"... and it is just showing a question mark. Additionally other items that are looking to that variable to act aren't working.

The trigger works off... "OnObjectEnter" which I should have thought would have fired when I click into the text field?

Just a thought...
It says that the value of the variable must be text, but I'll pulling from the primary key which is a number, is that a problem?

 

Any ideas?

Edited by Karlos Fandango
Link to comment
Share on other sites

can you post a screenshot of your layout in layout mode and of your script?

 

Text vs. Number: does not matter.  FM does a pretty good job at auto-casting data types.  If you want to be 100% certain that FM uses what you store in the variable as a number then wherever you use it do GatAsNumber( $$todo )

Link to comment
Share on other sites

can you post a screenshot of your layout in layout mode and of your script?

 

Text vs. Number: does not matter.  FM does a pretty good job at auto-casting data types.  If you want to be 100% certain that FM uses what you store in the variable as a number then wherever you use it do GatAsNumber( $$todo )

The portal is within a 'Tab Control', Now when I click on another tab and then return... the variable loads the right value. I added "commit record" to the script but then I couldn't edit the text field as it instantly committed, moving me to the next field.

I got it to work by using... GetValue

So its working, now I've just got to force it to work without having to leave the tab for another, then return.

I tried adding a link to an image on my google drive again, but it is hopeless... just get a spinning icon. But I here is a link to it on my drive...

https://drive.google.com/file/d/0B687aT8LAHKmbzRIaVNReVRENnM/view?usp=sharing

Where the "4" is, is where I added the merged variable <<$$todo>>

Edited by Karlos Fandango
Link to comment
Share on other sites

​I've added a merged variable to my layout to see if it is pulling the value as I haven't got 'Filemaker Pro Advanced"

​That's not a good method of testing, because the layout may or (more likely) may not be refreshed . To make sure your script sets the variable correctly, have it show it to you in a custom dialog or set a field to the variable's value.

 

​Now when I click on another tab and then return... the variable loads the right value.

​That's just one more indication that the real problem is with the layout object, not with the script.

 

​I got it to work by using... GetValue

​That makes no sense.

 

Edited by comment
Link to comment
Share on other sites

 

​That makes no sense.

 

Emphasizing this. Karlos; if you think you fixed it: you have not.  It just looks like it is fixed so if you having in there and show us your layout and your script we can help you fully understand what is going on.

Link to comment
Share on other sites

Emphasizing this. Karlos; if you think you fixed it: you have not.  It just looks like it is fixed so if you having in there and show us your layout and your script we can help you fully understand what is going on.

​Hi.

Acknowledging my failings in explanation I decided to do a short screencast, that done I uploaded it to my Google Drive, grabbed the link to view it only to find some three hours later Google still hasn't processed it. I'll now leave the link in the hope that it will be processed soon... either way it will be viewable eventually...

https://drive.google.com/file/d/0B687aT8LAHKmOWlfUXBSUVVXUHc/view?usp=sharing

I hope it goes some way in expounding my issue, better than my literary skills have.

Thanks, Karl.

Link to comment
Share on other sites

Finally I got it to work, unfortunately the video above does not play... I've had allot of trouble with Google Drive lately. But anyway, I've recorded another of my issue resolved...

https://drive.google.com/file/d/0B687aT8LAHKmMEpLaUI3dTYyUzQ/view?pli=1

I found that I could only watch the video if I changed it to 360p rather than the 480p it was trying to use.

 

 

Edited by Karlos Fandango
Link to comment
Share on other sites

This topic is 3270 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.