How do I make filemaker recognize records from an imported file - filemaker

I imported an excel list of student names and ID's. The teachers job is to either scan or manually enter student ID's and when done so, filemaker will automatically add the student name from the excel list. If the teacher mistyped the student ID, then the name would not show because it is not in the excel list. How do I make filemaker tell the user to stop and retype the student ID not allowing the teacher/user to add anymore students until they fix the current mistyped ID?

How do I make filemaker tell the user to stop and retype the student
ID not allowing the teacher/user to add anymore students until they
fix the current mistyped ID?
You can (and should) validate the field. The validation here could be as Member of value list: [StudentIDs], where "StudentIDs" would be a value list using values from the StudentID field in the imported table.
Note: Filemaker's validation error messages can be somewhat intimidating to the users, so you may consider adding a script triggered OnObjectValidate to run a "pre-validation" check and guide the user in case of an invalid entry, for example:
If [ IsEmpty ( FilterValues ( Attendance::StudentID ; ValueListItems ( Get (FileName) ; "StudentIDs" ) ) ) ]
Show Custom Dialog [ Message: "There is no student with this ID. Please correct your entry."; Buttons: “OK” ]
Exit Script [ Result: 0 ]
End If

Related

Access to use a query to generate a field value with no user interaction

I have fields in a table that need to get combined as user hits a button on the page.
Separate fields in a table are [Prefix], [First], [Middle], [Last], [Suffix], [Complete Name], [Quick Name] & [Friendly Name].
For example [Prefix] = "Mr."
[First] = "Bob"
[Middle] = "M"
[Last] = "Williams"
[Suffix] = "Sr."
Now make [Complete Name] of "Mr. Bob M Williams Sr."
[Quick Name] of "Bob Williams"
[Friendly] of "Bob"
There is a button to create one of each option when pressed. Parts of the name may not exist, (i.e. [Middle] or [Suffix]} but each name version would still have one space between each portion.
I have Queries that generate these values as they are built up in separate temporary fields, but it is only the last field the query performs that is the merged value.
Question: How do I create separate buttons on the form for Complete Name, Quick Name and Friendly Name that will call the existing querys and return a value to a field where the button is related. When I click on the "Friendly" button on the form a "Find Friendly" query is processed, and "Bob" goes to the [Friendly] field in the form.
It seems like more user interaction instead of just simply filling in the [Friendly] field.
I just want to hit the "Friendly" button and have the [Friendly] name appear on the page. My querys work fine by themselves, but how can they be processed when the button is hit?
I hope this is all clear and I hope for a great answer soon.

TRIGGER SALESFORCE/APEX

I have to complete a challenge and i have no idea where to starts it.
I created the object "customer", with the fields: name, birth date, age, and account (lookp up to account)
1- Dont allow insert record if the birth date is empty, and shows an error message to the user.
2-dont allow to create a record of customer with age less than 18, and shows an error message to the user.
3-if the field account is empty shoud create automatically an account and insert on the field.
4-when a record is created a new opportunity should be create and the field customer should be filled.
Can someone help me with that?

Autofill fields in a subform of access2003 based on a previous entry/field

First off, I am new at this. Secondly, yes I am working with access 2003 and this is not by choice. It is the program that my job has provided to me, so I am stuck using it.
Question: I have created a form with a subform in access2003. The form has three fields: State, Year and CompanyName.
The sub form then lists three fields: CompanyID, Date, and AmtPaid (in dollars).
I would like for the subform to autopopulate/autofill in the CompanyID in the subform each time I have users enter a new line of data in to the subform.
For example: I choose the following in the form...State=PA, Year=2017, CompanyName=ABC (ID=2).
I then can enter values in to my subform...CompanyID=2, Date=3/1/17, AmtPaid=$10.00.
When I go to enter a new line of data, for example the amount paid for the same company on 4/1/17, I would like for the CompanyID to automatically fill in "2". My goal is for this field to autofill for each company ID since I am planning on avoiding user error and also planning on hiding this field.
I understand the default assignment in the properties window of the field, but if i enter in the number "2", then "2" will be entered by default for all companys, not just for company ABC. I believe i have to write some sort of code that references a previous field or the first field in the subform, so that the new line copies what has been entered previously.
Any help is much appreciated in advance.

Insert new record to table without using portal

How can I insert a new record to another table that is related to the field im currently inputting data into without using a portal? Say that it is a dropdown button that has a value list from another table, but the record Im going to enter is not yet in that table so I am just going to type it. If it is a new record then it should be added to the other table for future use.
One technique is to create a script to do the record addition. You can then use a script trigger on the field or a button to call the script.
For example, let's assume that you have an Invoices table and a Line Items table, which is linked by this relationship:
Invoices::ID -----< LineItems::InvoiceID
You could create a script Make Line Item For Invoice ( InvoiceID ), and pass the Invoice::ID value as a script parameter.
The Make Line Item For Invoice ( InvoiceID ) might look something like this:
New Window [Name: "Create Line Item"]
Go to Layout ["Line Item Layout"]
New Record/Request
Set Field [LineItems::InvoiceID; Get ( ScriptParameter )]
Close Window [Name: "Create Line Item"; Current file]
It wouldn't be to hard, once you've got that working, to modify the script to take additional parameters and use them to set multiple fields in the new record.
You can fake it by making a very small portal (i.e. make it 1x1 pixel),
Then you can use the portal way: give to portal an object name, then when you want to add the record make Go to object [portal name], then Go to portal row with Last set and just put in the value (just make sure you have the Add option checked in the relationship)

Filemaker - Can I use a portal like a drop-down value list?

I am trying to work around a limitation that Filemaker 12 seems to have. In a value list that links to an ODBC attached SQL Server database, it doesn't display every piece of data. If there are 2 people with the same last name for example, it only displays the first person with that last name in the list. This is verified by the following in the Filemaker documentation (which I found after a lot of digging)
If the value list is defined to display information from two fields, items will not be duplicated for the field on which the value list is sorted. For example, if the value list displays information from the Company field and the Name field, and if the values are sorted by the Company field, only one person from each company will appear in the value list.
Portals on the other hand will find all the related data, I just don't understand how do something with the data once I get it in the portal. I essentially thus wish to use a portal AS my drop-down value list, and then to use it as I would have a value list (which is then to act as the key to do the rest of the lookups on the page to fill out the invoice.
The major issue here (other than this maddening choice Filemaker seems to make) is that the external file I am pulling the data from is an ODBC mounted SQL Server file, so I can't do something easy like a calculated field which would give me last name & " " & first which would make almost every person unique. Filemaker won't let me do that because it says I can't do that with a field that is not indexed. Any help would be greatly appreciated!
Assuming that we're starting with table MyTable and we're trying to get a ID from the People table for the selected person, which we'll call ID so that we can put it into MyTable::PersonID
Start by creating a new Table Occurrence of your People table and call it PeopleWhoCanBeSelected. If you want every person in the People table you can connect it to MyTable with the X relationship. If you want to show just a subset of the people you can build a different relationship.
Now, on a layout displaying records from MyTable you will make a portal showing records from the PeopleWhoCanBeSelected table.
In the portal put a button. When that button is pressed use the Set Field script step:
Set Field MyTable::PersonID to:
PeopleWhoCanBeSelected::ID
That should do it. You can make the button an invisible overlay on the entire portal record if you like, so that the user clicks on "the name" instead of "the button next to the name".
Now, if you want to pull additional data through to the MyTable record, you'll need to create a second Table Occurrence, called People with the relationship MyTable::PersonID = People::ID. Then you can get information on the specifically chosen person through that relationship.