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

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

Recommended Posts

Posted

Hello everyone,

I've got a problem here that I just can't seem to solve. I have a database of things "A" that I'd like to choose something out of database "B" to link to it. Or, if thing "B" doesn't exist, create one and link the new one.

An example would be to link a Drawing number from a database of drawings to a part in a database of parts. There's something like 10,000 drawings so that would be too many for a popup.

I'd like the user to be able to just type in the drawing number he wants linked (looking at his part screen) and click a button to link the two.

At the time of the cilick I can see if the drawing exists or not. If it does, I just grab its ID, stuff it into the part record and I'm on my merry way. But if it does NOT exist I need to create one, stuff the user's typed in drawing number onto it, grab the new record's ID and add it to my part record.

But that can't seem to be done. How can I create a new record then grab something from it or edit it?

This was a problem for me with FM6 and now I just tried it on FM7 and still I can't figure out how to make it work.

Does any of this make any sense to anyone?

Help? Please?

Many thanks in advance!!

-jim lee

Posted

You could build a script that went to a search layout (say with your drawingID and the partnumber), did the search, and if there were no records found, create a new record. Then select the contents of the drawingID field and bring it back to the first window.

I just would point out that you might want to put some sort of secondary user check into the routine; user-input is notoriously unreliable. Maybe a search by part name or something...

Posted

>You could build a script that went to a search layout (say with your drawingID and the partnumber),

>did the search, and if there were no records found, create a new record. Then select the contents of

>the drawingID field and bring it back to the first window.

This is what I'm trying. Its just the passing back of the ID from a newly created record that I can't seem to get. I know if I need to create-and-link or just link. Its getting the ID of the new one to pass back that has me stumped.

I played around with the attached file. Thanks millions for making that up for me. I'm -really- new to FM7 so I think I'm running into unknown territory that's throwing me for a loop. What is "accessible power"? Why do your new fields call themselves "Graphic" when they are added? How come your drawing layout looks like a standard layout in "Layout" and a table in "Browse"? I've never seen anything like this in my designs.. I must be missing out on a lot being self taught.

But.. This "commit changes", yet another script step I've never ran across before. This -may- be just the ticket. -IF- commit changes allows my script to survive after the new record is created, then the new record initialization routine can stuff the ID somewhere (like a global), I can grab it, and everything will be fine!

(Fingers crossed!)

Thanks again everyone!!

-jim lee

Posted

That was just the ticket!

The "commit changes" forced the update of the values and Vola! Everything was fine.

Thank you all very much!!!

-jim lee

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