Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Need help with Set field


Wingwalker
 Share

Recommended Posts

I have a relationship called “Contact Phone” that is related to a “Contacts TO” by ContactID. On my contacts layout I have the “ContactPhone” portal with the fields “Phone” and “PhoneType”.

 

I would like to set up a button to add a new portal row where a new number and phone type can be added. I know this is done with a Set Field but can’t seem to figure out how to make it work.

 

Thanks for your help,

 

James

Link to comment
Share on other sites

You want to add a new portal row but still have the two fields "Phone" and "PhoneType" remain empty for the user to populate with data?

 

You need for there to be at least one more field in Contacts TO (well, in the native table of which it's an occurrence, at any rate). It can be a Date Created field, it can be a nonsense field, whatever.

 

 

Go to Portal Row [Last]

Set Field [Contacts TO::FieldName, "Some Value"]

Commit Records/Request

 

 

 

This assumes that your relationship to Contacts TO is set up to allow the creation of records in Contacts TO via that relationship.

Link to comment
Share on other sites

Hi and thanks for getting back to me,

 

Here's what I did.

 

Go to Portal Row [Last]

Set Field [ContactPhone::Phone; Contacts::NoValue]

Commit Records/Request

 

I know you said to use the [Contact] TO in the Set Field, but the "Phone" field is only in the ContactsPhone relationship. The [Contact] TO and the [ContactsPhone] are related by the ContactID field.

 

What happens when I run this script is it enters the Phone field in the first record and erases the phone number that is already there.

 

James

Link to comment
Share on other sites

No, you absolutely HAVE to use the same table occurrence as the one used by the portal.

 

If the Phone field is in the native table "Contacts", it doesn't matter if the field appears in the PORTAL, it's still accessible by the table occurrence OF the portal.

Link to comment
Share on other sites

Then I don't understand why it's not working. The portal is ContactPhone and it is related to the Contacts TO. Based on this and my last post, where I explained where everything is, what am I doing wrong? I don't know why i'm not understanding this.

 

James

Link to comment
Share on other sites

Well, are you sure that the relationship to ContactPhone is set up so as to allow for the creation of records in ContactPhone via that relationship?

 

Manually click into the bottommost portal row. type some stuff in a field, then click out of the field. Do you automatically get a new blank row below it? If you don't, your relationship is not set up to let you create new recs via the rel.

Link to comment
Share on other sites

Oh! Another possibility: do you have more than one portal on that layout?

 

You tell FileMaker to Go to Portal Row [Last] and FileMaker flips a metaphorical coin, not necessarily utilizin the portal (& portal row thereof) that you had in mind.

 

So what you do is preface it with a go to field:

 

Go to Field [Contact Phone::SomeVisibleField]

Go to Portal Row [Last]

Set Field [Contact Phone::FieldName, "Value"]

Link to comment
Share on other sites

Oh-Oh,

 

I have three portals on the layout and I have the "Allow related records in this table" un-checked. I did this because I do not want a new portal row to automatically show. It just doesn't look good in my opinion and I thought you had to uncheck Allow related recrods and then set up the script we're talking about.

 

Knowing this, do I continue on with your last post and what about the "Allow related records in this table"?

 

James

Link to comment
Share on other sites

Well, if for aesthetic reasons you don't want to show that empty portal row at the bottom, you need to create your records in a different fashion.

 

Set Variable [$ContactID, LocalTable::ContactID]

Go to Layout [Layout Using Contact Phone as its native TO]

New Record

Set Field [Contact Phone::ContactID, $ContactID]

Go to Layout [original layout]

 

Now you aren't creating the new records "through" the relationship. And you don't have to worry about which portal or anything because that's covered by going to a layout that's native to the portal's relationship.

Link to comment
Share on other sites

Hi AHunter3,

 

Thanks for your help but when all is said in done i'm just going to forget it. I new going in i'd not figure it out! I tried with someones help from the forum once before and got no where. I did what your last post said and it did generate the new record on the layout but it did not give me a new line on the portal.

 

I've wasted much more of my time and yours on this stupid thing and the reward, if I ever got it, is not worth the time investment. If it sounds like i'm fed up with the whole thing it's because I am!

 

Again, thank you very much for the help but I GIVE UP!

 

James

Link to comment
Share on other sites

Hey James,

I've wasted much more of my time and yours on this stupid thing and the reward, if I ever got it, is not worth the time investment. If it sounds like i'm fed up with the whole thing it's because I am!

 

Again, thank you very much for the help but I GIVE UP!

 

James quit being such a crybaby smiley-cry and dig in and get-err-done man! Here’s a file even you can figure out even though you're such a deadbeat. And here you live in Chicago "The city with big shoulders" and there you are slouching down like some little girlie-mon! smiley-surprised

 

Oh and I password protected it because you’re such a weenie. Open it with wa-wa-wa!smiley-wink

 

Now quit feelin sorry for yourself, dust yourself off and get back in the game fella.smiley-tongue-out

 

Yah, finely some tough love!smiley-laughing

 

Harry

Link to comment
Share on other sites

Harry, I don't believe James can download your file. He is a guest member. smiley-sealed

 

James, I've quit thousands of times. I can't tell you not to give up but consider this (shared with me at one time when in one of these moods):

 

... clipped from FM License Agreement ... Restricted Uses. THE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL SYSTEMS, LIFE SUPPORT MACHINES OR OTHER EQUIPMENT IN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.

I remind myself of it quite frequently. Nothing is so important that it sway you from your task. Give up. Then rest. Do other things. Then come back and attack it again.

 

About your post ... I never create new records in portal. Instead I script going to the other table. Why? Because it never fails that I'll move a portal (change stacking order on layout) or change the table occurrence the portal references ... and BREAK my new record script. Too much can go wrong when creating records this way.

 

BTW, add a Freeze Window to the beginning of that new record script provided by AHunter3 - it'll look better to your Users. If his script didn't work, you must tell us your script so we can help you! One of the problems with this type of provided help (only through WORDS) is that we can't see what you see. So tell us 1) what you did (script steps) and 2) where it broke in the process ... oh. But tell us AFTER you've quit and rested.

 

LaRetta smiley-laughing

Link to comment
Share on other sites

James, James, James, James...

 

When you wholeheartedly adopt a "with all your heart" attitude and go all out with the positive principle, you can do incredible things. Never Mind!

 

Snap out of it kid!

Link to comment
Share on other sites

Hi all,

 

Boy do you guys have this "Good cop bad cop" down to a science or what? Harry trashes me, LaRetta picks me up and Ross gives me a little Vince Lombardi!

 

Sorry for the frustration coming through. Just when I think I’m really learning this Filemaker something that is suppose to be simple just throws me for a loop.

 

Harry thanks for sending me the file. I still wouldn’t have gotten it without your explanation, so thanks for the help and thank all of you for well, giving a damn!

 

James

Link to comment
Share on other sites

Just when I think I’m really learning this Filemaker something that is suppose to be simple just throws me for a loop.
Ah. Now is a good point to apply another theory gleaned from a friend ...

 

These frustrations - picture FM (and all software) as very clever gremlins. And their purpose is to expand your wisdom by flashing your lack of understanding in front of your face so you can learn. These gremlins are on YOUR side; without them, you would learn nothing. So when you see them dancing around your system, just smile, relax and be prepared to grow. And thank them.

 

These gremlins are teachers! Except you are learning through experience. Experience is a tough teacher - it gives you the test THEN provides the lesson. But, oh dear Lord, do 'experience' lessons stick!

 

And welcome back. smiley-laughing

 

L

Link to comment
Share on other sites

Hello again there your Wing-Ness...

 

James you’re a good sport and I’m happy you took it as we meant it. Anyone that does this crazy FileMaker thing and doesn’t admit like La Retta, that its sometimes a little much, is a habitual prevaricator. That’s liar to any Alabama Americans out there!smiley-smile

 

Not long ago I was talking to David Kachel, he dose the “WhitePaperForFMPNovices” and has some other solutions I’ve mentioned to you. He also has a solution called AutoNavator that he and I were talking about by sending emails back and forth. Now this is a guy that knows something about FileMaker I can guarantee you that. And just when I’m sure he’s thinking, “This guy Harry knows his stuff” I had what can only be described as a “Moment”! Others may call it by other names but I’ll stick with “Moment” because La Retta may be lurking on the forum and she doesn’t take to no trash talk! And Ross, well he'd just call me for the mangy cur I am! Anyway, I have no doubt that David sat back, scratched his head and thought, this guys an idiot! Or at least a Taco short of a Fiesta platter…smiley-surprised

 

My point is… You know as well as everyone else here on the Café that no one knows more about FileMaker than I do. Yes, sometimes repeating that 50 times a day for a month to a year moves that thought process along a little.smiley-wink But the bottom line is “I didn’t get it”, I know I should have with his first explanation, but I didn’t. Finely at 2 AM the next morning I set straight up in bed and “I got it”. I woke my wife but she said that was all I was getting… Don’t you hate when that happens!smiley-tongue-out

 

Anyway, the people on the Café are the greatest anywhere you just let us know where we can help! Sorry if we made you tear up…smiley_cool

 

Harry

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use