For the FileMaker Script Step "Set Next Serial Value", how can I specify the table and field name dynamically? - database

I'm writing a script that's intended to work for multiple layouts and table occurrences. For each, it will determine the primary key and then find the maximum value in any record for that primary key field. That's all working well. Now, I've computed my intended next serial value and would like to assign this to a field whose name I have saved in a variable. I am unable to specify the target field by using a variable. I only see an option for selecting the table and field from a list of existing fields.
My questions:
Is there a way to dynamically specify the target field?
Why is there a checkbox for "specify target field"? I see that I receive error 102 (missing field) when I do not specify a target field. I don't understand why it's optional but returns an error if it is not used. Why not make it mandatory?
I've tried:
The script step "Go to field". I was hoping that having this script step placed before "set next serial value" would allow me to leave "specify target field" blank. But there's still error 102 for "set next serial value". And "go to field" also cannot be specified dynamically.
I'm working with FileMaker 11, but I've also investigated FileMaker 15 and it's also not possible to specify a target field from a calculation. In both FM 11 and 15, it's possible to specify the number of repetitions from a calculation, but not the target.
I've considered various approaches for determining the next serial value but all of these hinge on being able to specify the target dynamically. In case this is not possible, I will need to re-think my strategy and write scripts for each table in the database separately.
Here's a discussion on the same question that I have. http://fmforums.com/topic/93934-set-dynamic-next-serial-value/ My question about why "specify target field" is optional was not answered there so I thought I would ask the question here in case anyone has additional information.
As you might notice, I'm relatively new here, so I would also appreciate any tips about how I can improve the formatting or content of this question.

Before we had Set Next Serial Value, we used Replace Field Contents to get the same effect, but it's more complicated, although it will allow you to do it dynamically. The basic idea is that you'll need to be on the record that has the maximum serial number, isolate that record, make sure you're on a layout with the serial number field, go to that field, and use Replace Field Contents to set the field to itself while also updating the next serial value. The script would look something like this:
Go to Layout [ // layout that has the target field ]
Enter Find Mode
Set Field By Name [ $_target_field ; $_max_serial ]
Perform Find
Loop
Go to Next Field
Exit Loop If [ Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName) = $_target_field ]
End Loop
Replace Field Contents [ No Dialog ; Replace with serial numbers: Custom values ; Initial Value: $_max_serial ; Increment by: 1 ; Update serial number in Entry Options ]
No, I haven't tested this out on a sample file, but it's the basic technique we used before FileMaker, Inc. gave us Set Next Serial Value.

Related

assign a reference to an indicator dnamically in a for loop

I have a large number of internal path references in a LabVIEW project. Each path is entered manually into a bundle function along with a reference to a numeric indicator on the block diagram. Because I have a lot of paths and therefore a lot of numeric indicators, the block diagram is a big mess.
I want to streamline this by having a CSV file with a nx2 array. on column 1 I want to have the path of the internal reference itself. On column 2 I want to have the name of the numeric indicator (already placed in the block diagram and front panel) that corresponds to the path in column 1. Using a for loop I want to loop over each row of the CSV file and using a bundle function, bundle the path (on index 0) and a reference to the numeric indicator itself. Here is the actual problem I am having since I don't know how to dynamically assign the name of the numeric indicator (on index 1) to a digital reference as the loop executes. See the state of my current VI for more reference. Please help me find a way to dynamically crate digital reference to each numeric indicator as the loop goes through.
Right now, the closest I got to the goal is to get the name of the numeric indicator (index 1 on the CSV) assigned to a string reference, but my numeric indicators are still unreferenced and not connected to the bundle function.
Note that the column 2 in the CSV has the same name as the numeric indicators, so "numeric","numeric 1", "numeric 2", "numeric 3", "numeric 4"
Read this https://forums.ni.com/t5/LabVIEW/How-to-get-control-reference-from-control-indicator-label-name/td-p/3884075 to learn how to obtain control/indicator reference by its name. That should solve your problem. Use first CSV column as file path and the second column to obtain indicator reference. Then bundle two of them and that's it!

Where does the value of 'Last changed on/by' is stored for any element in 'se11' (Inside attributes tab)

I want to find out 'last changed on/by' for a large number of elements going in 'se11' and checking it's attribute value .
So instead of copying each elements name and checking it's attribute for the same value, is there any table or database in which i can get the values for multiple entries at once?
Picture is attached in the question for the reference.
With the cursor placed in the field you're interested in, press F1, then select the technical info. This will show you the table name or - as in this case - a structure named RSDXX, which is not what you're looking for - but it is the fastest way in some cases.
Alternatively, start transaction ST05, enable the SQL trace and navigate to the display in a separate window. Then stop the trace and examine it - you will find a list of all tables accessed for the process. Very near the top of the trace list, you will find a table named DD02L which is the one you're looking for in this case.

Printing records with condition Crystal reports

I am using stored procedure in mssql as backend, vb.net as frontend (just info).
There are a lot of records in the database and I am printing in crystal reports.
Now I want to filter the records from crystal report and not by adding a new parameter to procedure or changing database structure or else.
For now,Say there are columns : Name , Amount.
I want to put filter in amount like only display records whose amount above 100 or something. So other records with less than 100 should not be displayed.
This filter will be passed by the user so it'll be random.
I can't find a proper answer on internet. Might be a duplicate question, if so please post the link of the question if it is duplicated.!
Thanx anyways...!
In general the idea is to:
Create the parameter (user choose what will be the input/value) - link
Set filters, what values should be displayed in regards to parameter - link
On right side there is a DataExplorer window, where You need to add a Parameter (define his name, what question will be shown to user and what type the param will be / what values can be set inside).
Once done, You can jump to Data tab of a report, click Interactive Filter and specify which column must fit what condition with what value = Parameter (that one user will enter in Report).
Example: I will create AmountParam, with message "What should be the minimum amount?". Type will be set to Integer. Going to Report->Data->Interactive Filter, choose Amount as a Column, AmountParam as a Parameter and set condition Greater then (>).

MS ACCESS Report - Using CODE to change a value in a field from an OPTION Group to a different value

I have a report in ACCESS that Is based on a query of a table populated by a form with an Option group. ( to try to explain this better - Table is inspector qualifications, the query pulls all of the qualifications for the inspector, the qualifications are selected via option group on a form that populates the fields of the inspector qualification table.) Of course, the choices are stored as numeric values, "1, 2, 3 or 4" in the table, but 4 actually designates a N/A or NONE. Since everything is already built out this way, I am trying to write a code that will run when the report is generated (or opened,) that will take the "4" value entered (if the field equals that) and change it to a Null value /blank in the report - not in the query or table. I still want this report to generate everything else as is - show all records - just change the value if that particular option is the one shown in that field for that particular record.
Anyone know of a good way to do this? Any help would be GREATLY appreciated!!!!
You would just place an 'IIF' in the query that tests for the value you want to change, then either changes it to something else, or retains the original value. The below will test field 'Nbr1' for the presence of a 4, and if found, change it to 'N/A', otherwise it stays the same.
Note! You will need to change the control source in the report to reflect the name you provide (i.e. 'MyChange') because you can't keep the original name.
SELECT Table1.ID, Table1.EMPID, Table1.TestResult,
IIf([Nbr1]=4,"N/A",[Nbr1]) AS MyChange, Table1.Nbr2
FROM Table1;

Import CSV to class structure as the user defines

I have a contact manager program and I would like to offer the feature to import csv files. The problem is that different data sources order the fields in different ways. I thought of programming an interface for the user to tell it the field order and how to handle exceptions.
Here is an example line in one of many possible field orders:
"ID#","Name","Rank","Address1","Address2","City","State","Country","Zip","Phone#","Email","Join Date","Sponsor ID","Sponsor Name"
"Z1234","Call, Anson","STU","1234 E. 6578 S.","","Somecity","TX","United States","012345","000-000-0000","someemail#gmail.com","5/24/2010","z12343","Quantum Independence"
Notice that in one data field "Name" there is a comma to separate last name and first name and in another there is not.
My plan is to have a line for each field (ie ID, Name, City etc.) and a statement "import to" and list box with options like: Don't Import, Business>Join Date, First Name, Zip
and the program recognizes those as properties of an object...
I'd also like the user to be able to record preset field orders so they can re-use them for csv files from the same download source.
Then I also need it to check if a record all ready exists (is there a record for Anson Call all ready?) and allow the user to tell it what to do if there is a record (ie mailing address may have changes, so if that field is filled overwrite it, or this mailing address is invalid, leave the current data untouched for this person, overwrite the rest).
While I'm capable of coding this...i'm not very excited about it and I'm wondering if there's a tool or set of tools out there to all ready perform most of this functionality...
I hope this makes sense...
Is there a header row?
usually in CSV files, the first line is the header.
If so you could use the header line to determine the order, just have a list of column names, and only prompt the user if a column name does not match.(this could then be auto added into the predefined list).
EDIT:
even if a header does not exist, its simple enough to add one. The file can be manually edited. Alternatively in your program let the user define it (from your predefined list)
I can't find any tools all ready out there and no one has replied otherwise, so for the sake of leaving a question answered until otherwise notified the answer is: no.

Resources