857 Views    -    5 Replies


Username Post: Create a Variable based on a object        (Topic#214343)
Your continued generosity and support of FMForums is greatly appreciated.
Maartenjanvdwielen 
novice
Posts: 6

Post Rank (AVG):
            


FMP: 10
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
   This is Maartenjanvdwielen's fourth post.
04-15-10 04:02 AM - Post#354587     - Post Rank:             


Im trying to create a single script that could send me a mail with a lot of info based on the layout the user is currently on.

For the moment i have like 18 scripts and if i have to make a change i have to change them all!

So now i decidet to create a single script that could handel all layouts.

My idea is to copy from objects set on the layout and past that in globalfields in order to make a $variable. So far so good, it works like a charm and i get all the variables i need!

Untill! a object is empty, then the previous copy will be past into the global and i get the wrong variable!

Iam trying so hard to get a variable direct from a object but so far no progression.

Now i could solve this by emptying my clipboard in the script OR (i like this more) Get a variable direct from a object (the field context)!

Hope you understand and will be able to send me the right direction!

Best regards,

Maarten-Jan


Edited by Maartenjanvdwielen on 04-15-10 04:03 AM. Reason for edit: No reason given.










BruceR 
Pooh-Bah
Posts: 2218

Loc: Redmond WA
Post Rank (AVG):
            


FMP: 11 Advanced
OS: Mac OS X Snow Leopard

Member: TechNet
Skill: Expert

Certified:
     

DBUG SIG

Tweet This! Tweet This Post!
04-15-10 05:56 PM - Post#354643     - Post Rank:             
    In response to Maartenjanvdwielen

Sorry but no, I don't think it is at all clear what you're trying to do. Can you post an example file; plus give very specific examples?










Maartenjanvdwielen 
novice
Posts: 6

Post Rank (AVG):
            


FMP: 10
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
   This is Maartenjanvdwielen's fifth post.
04-16-10 12:49 AM - Post#354651     - Post Rank:             
    In response to BruceR

Oeps sorry, this is realy hard for me :P and together with my second language english this is almost impossible.

but ill try again.

What i have is a database with about 16 layouts with different types and fields. But i always have a script in order to create a a pdf of the current layout attach it to a mail and send. The way i was working untill now is to make a script for every layout. Due to the problem the field are different in every layout. So i guessed to work with objects. In that way i could make an easy script that is getting his information by OBJECTS set on every layout. but i could not find a way to get a variable out of the objects.

Sorry if still impossible to understand

Attachment: Variable.zip (5.96 KB) 47 View(s)












comment 
consultant
Posts: 15780
comment

Post Rank (AVG):
            


FMP: 7 Advanced
OS: Mac OS X Panther



Tweet This! Tweet This Post!
04-16-10 01:50 AM - Post#354652     - Post Rank:             
    In response to Maartenjanvdwielen

I believe the best way to do this is to use a script parameter:


Attachment: ScriptParameter.fp7.zip (6.37 KB) 45 View(s)












Maartenjanvdwielen 
novice
Posts: 6

Post Rank (AVG):
            


FMP: 10
OS: Windows Vista
Skill: Entry Level



Tweet This! Tweet This Post!
04-16-10 02:12 AM - Post#354654     - Post Rank:             
    In response to comment

Your kidding right? :P

unbelievable, i think i better stop working with filemaker and start making sand castles im better in my last.










Your continued generosity and support of FMForums is greatly appreciated.
BruceR 
Pooh-Bah
Posts: 2218

Loc: Redmond WA
Post Rank (AVG):
            


FMP: 11 Advanced
OS: Mac OS X Snow Leopard

Member: TechNet
Skill: Expert

Certified:
     

DBUG SIG

Tweet This! Tweet This Post!
04-16-10 09:06 AM - Post#354680     - Post Rank:             
    In response to Maartenjanvdwielen

There are some additional things to learn here. Passing script parameters is an important tool to understand. But in your own script, there were some errors as well.

If you were to use the named object, you do not need to go to it. Instead, set variable $mail; getLayoutObjectAttribute( "mail"; "content")

As it is now, you declared a variable name; but did not set its value to anything. You would want to use get( activeFieldContents ) at this point in your existing go to object select all script.

Edited by BruceR on 04-16-10 09:07 AM. Reason for edit: No reason given.










Icon Legend Permissions Topic Options
Print Topic

Email Topic

857 Views
Welcome Guest...
Enter your username and password to login. If you do not have a username you can register one here

Username

Password

Remember me. Help



Forgot Password...


Quick Links
Recent Posts
Active Topics
No Replies
Recent Files
Functions & Scripts
FileMaker Pro Help
FileMaker on Twitter
FileMaker Marketplace

Custom Search

Find FileMaker Developers

Don't have time to wait,
hire a developer now!

Recent Members
Welcome them to our community!
Find FileMaker Jobs

Want a new career?
Find your new job now!

Joy of Tech
Latest Joy of Tech!

Recent Topics
Recent Hot Topics
Contribute
With your generosity we can make some real magic happen!. Support your favorite online FileMaker community...
FM Forums.com


Click here...


Or a Donation of any amount.


Thanks for your support!

Active Blogs
0 Recent blogs:
People to Post Lately in this Topic
Maartenjanvdwielen
BruceR
comment
FM Forums Advertisers


FusionBB™ Version 3.0 FINAL | ©2003-2010 InteractivePHP, Inc.
Execution time: 0.678 seconds.   Total Queries: 86   Zlib Compression is on.
All times are . Current time is 01:36 PM
Content ©1996-2008 Ocean West Consulting, Inc. All Rights Reserved
Ocean West Consulting, Inc. can not and will not be held responsible for any of the contents in this site.
FM Forums™ is a trademark of Ocean West Consulting, Inc an independent entity, not affiliated with FileMaker Inc.
FileMaker® is a registered trademark of FileMaker Inc.
Top