Jump to content
Server Maintenance This Week. ×

Auto enter related field


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

Recommended Posts

Hello

I am sure the answer to my question is out there, but because it is so general, I have found a lot of unrelated stuff.

I have three tables as seen in the attached.  I am working in a layout based on Job Sheet Main and have a portal displaying Job Roles. I wish to select an organisation (company) by name (not ID) in this portal and have the CompanyID auto enter. 

Which is the simplest way to do this please?

Thanks

 

 

Screen Shot 2017-01-11 at 09.11.59.png

Link to comment
Share on other sites

2 hours ago, William Lindsay said:

Which is the simplest way to do this please?

The simplest way is to define a value list using values from the CompanyID field, also displaying values from the CompanyName field, and set it to 'Show values only from second field'. It will look as if you're selecting the name - but the value entered be will the ID.

Link to comment
Share on other sites

Thanks comment. I actually have this set up as you describe. My users are picky and want consistency throughout - see attached. Would it be possible to select the organisation from a drop down and have it all populate the ID via a calculation?

Screen Shot 2017-01-11 at 12.39.25.png

Link to comment
Share on other sites

I am afraid I don't fully understand what you're saying. To get the kind of display your screenshot shows, place the related CompanyName field on the layout, make it non-enterable, and use it to cover the local CompanyID (foreign key) field that has the value list attached to it. When they click on it, the underlying field will activate and they will get a drop-down (or pop-up) to select the name from.

The alternative where they would actually select the name is much more complex: you would have to define another relationship to another occurrence of the Companies table, and use it to make the local CompanyID field lookup the corresponding value from there.

Note that you can also select from portals or list views.

--
P.S. Please update your profile to reflect your version and OS.

  • Like 1
Link to comment
Share on other sites

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