Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Need a script to change a Drop Down Value

Posted on 2010-09-14
14
469 Views
Last Modified: 2012-05-10
I have 2 Databases, one is SQL, and the other is FMP. They are linked together, and I'm in the final stages of tweaking it for the end users.

They wanted to know if there was a way to change a Drop Down indicator in Photo Status to show Loaded/Up On Web, (This is one of the choices they have) when ever there is data sitting in the SQL database field.

So for instance if my SQL database has Picturescategory|123456.jpg, the photo status field on the FMP DB would automatically show Loaded up on web.

I assume script can do this, but not sure.

Any help is appreciated and more Q's to come I'm sure.

Thanks

Chip
0
Comment
Question by:OSXFreak
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33674714
Will the field be empty if its not on the SQL Database?  How is the drop down being populated now?
0
 

Author Comment

by:OSXFreak
ID: 33674829
Currently the field is empty.. BUT I set it up as a control style of Drop Down List. In that list is 5 values they can choose.

ONE of them being Loaded / Up on Web
0
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33675008
Are these values hard coded or from the value of a field?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:OSXFreak
ID: 33675071
They are hard coded from the Value Lists under value list name of Photo Status would is custom values

Does that help?

In other words, if you go to the Inspector and select Data then under the control style it shows values from Photo Status, if you click on the pencil it shows Manage Value Lists or Content Project. This is one of 4 lists :)

Hope that helps if not let me know and I'll see if I can do this another way :)

Chip
0
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33675171
OK, I think I have it now.  If the list is typed in by you, "Loaded/Up On Web" is one of the values and you have assigned this list to the field, then when you display the field is will already be selected.

Now, how do you populate that value in the field?  If the field is part of the SQL database, then do it there.  

If it is not part of the SQL database, then create a calculated field that checks to see if the Picturescategory has a value and based on the result set the value.  The challenge here would be, because it is a calculation the user would not be able to change it.
0
 

Author Comment

by:OSXFreak
ID: 33675278
Hmmmm my fear is that if it's a Calculated field they will not be able to select the other options for other items in that same field..

Thinking we might just have to work around it..

So next Q. If in the list view, and I do a filter on PhotoItems for any data in it.. Is there a way to select ALL the related records in Photo Status and do a paste of "Loaded/Up On Web" in it???
0
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33675358
Would you kindly provide more detail on the flow of data?  I think what you are trying to do is move images from the local to the server?  And then indicate which ones are already loaded?  Is this correct?
0
 

Author Comment

by:OSXFreak
ID: 33675548
Kind of..

OK so I have 2 Fields..
Field 1 has text from SQL The text is either PicturesCategory\NoPic.jpg or PicturesCategory\123456.jpg (the numbers represent the part number)

Field 2 (Photo Status) is a list created in FMP. This is connected to the FMP database.

The photo status has control style of Drop Down List and Values from Photo Status. The Values in that Photo status are..

Need Image from cono
Photo Taken / Needs Proofing
Photo Taken / Proof Rejected
Done / Proofread, Load to Web
Loaded / Up on Web

So basically I want to to do this.. IF Field 1 = PicturesCategory\123456.jpg then Field 2 (Photo Status) = Loaded / Up on Web else Blank so the end user can select a option or value manually. :)

Yeah easy for me to say. I'll attach photo's of the info. I'd send the data, but not sure you could use it since it's tied to my SQL database locally :(

Thanks

Chip


cbinfo.JPG
cblistmenu.JPG
listvalue.JPG
0
 
LVL 28

Expert Comment

by:lesouef
ID: 33675766
thinking of an auto-entered field from calc instead of a full calc field; this allows further change by the user. just my 2 cts.
0
 
LVL 4

Expert Comment

by:mac_guru
ID: 33675884
On your Photo Status set it to a text field and under options, use Auto-Enter with Calculated Value, and do a if/then/else statement to fill out the field.

e.g. If ( Field1="PicturesCategory\NoPic.jpg" ; "" ; "Loaded/Up on Web" )

That means if Field1 = "PicturesCategory\NoPic.jpg" give it a blank value otherwise set the pulll down to "Loaded/Up on Web"
0
 

Author Comment

by:OSXFreak
ID: 33676875
Mac I put that in my system.. but does not seem to be working...The SQL database that has the info is called idnmaster1::itemphoto the fields either have PicturesCategory\NoPic.jpg or PicturesCategory\######.jpg
I think your on the right track, but not sure if I have it set right, I'm attaching the screen shots of the code I used.
I did not set the global thing does that need to be done as well for the Photo Status field?

Chip
0
 

Author Comment

by:OSXFreak
ID: 33676876
Mac I put that in my system.. but does not seem to be working...The SQL database that has the info is called idnmaster1::itemphoto the fields either have PicturesCategory\NoPic.jpg or PicturesCategory\######.jpg
I think your on the right track, but not sure if I have it set right, I'm attaching the screen shots of the code I used.
I did not set the global thing does that need to be done as well for the Photo Status field?

Chip
ifcode.JPG
0
 
LVL 4

Accepted Solution

by:
mac_guru earned 500 total points
ID: 33677125
Chip,

No, don't need to set it as a global, globals holds a single value throughout the database.

I don't see anything wrong with your field.

See the attached example if that works for you.
chip.fp7
0
 

Author Closing Comment

by:OSXFreak
ID: 33716540
Never got it to work, so will think of other solution, but thanks anyhow.. I'm sure it's just ME :)
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question