Filemaker Script API More than One Layout - api

I have a script in filemaker, which takes few datapoints from a layout then go to a different layout and import them.
Currently in filemaker I can simply set the fields I want as variables then use the "Go To Layout" command, go to a different layout, then request new record, then set my new field like follows:
My problem now is when I trigger it via an API call. it doesn't allow me to go to a different layout, I keep getting Error Code 3 when I run the above code from API call:
https://localhost/fmi/data/v1/databases/DB1/layouts/TempList/script/ImportFromTemp
Is there anyway to solve this? Or is there another way to write my original script so it can achieve what I want but not using the "Go To Layout" command.

Is the screenshot the complete script?
If so, you might not have enabled access to the layout for the user account you are using for Data API. Check it at File->Manage->Security->Advanced Settings->Select the Privilege Set of the data API user->Check both Records and Layouts dropdowns for the required access.
Alternatively, try Grant Full Access to the script. Right click the script name in script workspace->click Grant Full Access Privileges.

Check your version of FileMaker Server. I forget the exact version where this was fixed, but at some point between 18.0.1 and 18.0.4 they fixed some permission issues.
You need to check all of the security settings for the privilege set the account uses. Records, Scripts, Layouts, etc.

Related

Sign Databases on Domino server side

I have a need to sign database(s) on server-side using Java (preferably). I tried sign method
Database.sign()
however it only works if you run it on workstation (doesn't work if code runs on server). I have also checked if any command for console to send them via
session.SendConsoleCommand
I wonder if there is something I miss and it's possible to sign databases?
I am considering now to update every design element in database instead.
In the Files panel in Domino administrator, right-click on a database. You will see "Sign" as an option on the context menu. You can also sign multiple databases by right-clicking on a folder, or by using a combination of shift-click and control-click to highlight a multi-selection and then right-clicking.

How do I see the source tables that Infor XA Power-Link is using to create the current view?

Through Infor XA Power-Link, I have access to a sales history view with things like quantity, price, item number, etc.
Using System i Navigator, I would like to be able to run a SQL script that produces a similar table, but customized to my liking.
However, I'm having trouble locating the tables involved in producing the Power-Link view. Is there a way to check the source using Power-Link so that I can get the table names?
Sure is! You need to use the SQL Monitor. Start the business object and go to Help then About Infor. The about screen will appear. Hit Control-D to start the SQL Monitor. You should see 3 columns: Start, Duration and SQL. Refresh the view and see the SQL Monitor will populate. Right-click and copy the entry that has 'SQL SW executeQuery' entry and paste into your favorite SQL editor. This will be the exact SQL select statement used by PowerLink. Modify to your needs.
Let me know if you need anything else.
Matt
Note: You can prevent users from accessing any of the Diagnostic tools which includes the SQL monitor. This is done via security task DSPDGNINF. It's located under the CAS application > Client System Preferences security area.
Load menu AMZM38 - CAS Security Maintenance
Select Option 1 Area and task authorizations
Select CAS as the application
Use Option 2 Change on Client System Preferences security area
Use Option 11 Authorize users to configure who should have access and who should not (revoke)
F12 to go back one screen
Lock task DSPDGNINF
Please note, security is not active until the task is locked. Also, to test, one must use a new Power-Link session as security is cached.

Create a log for all SQL action in Access

I'm currently having a problem at work.
Someone in the is modifying the table directly.
For example in my database I have school names like ETS. Well, today it was named Polytechnique.
What I'm trying to tell who did this modification either by his/her IP address or any other way. I currently have no ideas on how to proceed.
What I would like is just the beginning of a solution as to let me figure a part of it . I sadly don't have any ideas for the moment.
Thank you (I'm sorry for any errors english is not my first language. Also I could be mistaken for the tags)
(Welcome to SO. Sorry no one answered your question yet. It almost never takes this long.)
The short answer is: No. There is no way to find out who was modifying your tables directly. Access does not have any kind of automatic change logging, and you cannot create any logging procedures in VBA that will monitor manual changes to the tables.
One of the requirements for Access as a front-end is that you trust your end-users to not open tables and edit the data directly.
To prevent this in the future, here are some options:
Right click on your table to hide it. However, the user can just unhide it if they know it is there.
In your Access db is an option called "Display Navigation Option". Disabling this will hide the side-bar so the user can't see the tables. However, pressing F11 will still display them again. This can be easily googled, so I don't recommend it if your users are motivated.
Store your data in a SQL server and use connection strings (not direct links) to retrieve and store information.
Distribute your Access db via Sharepoint. The user will only be able to access the forms you specify and will have no direct access to the tables.
Consider another software package for your problems.

Free Software to Allow Users to Run Oracle SQL Scripts but NOT create them

We would like to allow users to run custom Oracle 11G SQL scripts that have been created for them, complete with parameter prompts, and get a CSV extract of the resulting dataset. Right now, I just use SQLPlus and SQLDeveloper to do those things, but those tools would allow the creation of custom scripts as well, and we do not want users to try to create custom queries.
In many cases we intend to fulfill this need with Crystal Reports/Crystal Server, but we use CR XI, and sometimes very WIDE extracts are difficult to create because of the page size limitations. It also has a limit for the number of concurrent users, and sometimes we may need more.
Does anyone know of a FREE tool that can allow users to execute Oracle SQL Scripts and get file exports as a result and yet will NOT allow them to create new Scripts?
NOTE: We have a Citrix environment and therefore are able to limit where the script files are located and what access users have to those files and folders.
Given that a SQL script is just a text file, I'm not sure I see how this could be possible but perhaps I'm missing something about how you see something like SQL*Plus allowing the creation of custom scripts. If you give me any tool that runs SQL scripts, I can always open my favorite text editor, write a SQL script, and have your tool run it (assuming that you allow users to create new files in your Citrix environment or to map a file from their local machines).
Personally, I'd probably create a small APEX application in the database that would present a menu that let users pick an export. Behind the scenes, the APEX app would run whatever select was necessary (I'd generally create a CLOB in the database rather than a file on the file system assuming unless you're making a great deal of use of SQL*Plus formatting commands in your scripts) and would allow the user to download the file (or use some alternate file delivery mechanism such as email).
I use jasper reports for that: http://jasperforge.org/index.php?q=project/jasperreports

Building an auditing system; MS Access frontend on SQL Server backend

So basically I'm building an app for my company and it NEEDS to be built using MS Access and it needs to be built on SQL Server.
I've drawn up most of the plans but am having a hard time figuring out a way to handle the auditing system.
Since it is being used internally only and you won't even be able to touch the db from outside the building we are not using a login system as the program will only be used once a user has already logged in to our internal network via Active Directory. Knowing this, we're using a system to detect automatically the name of the Active Directory user and with their permissions in one of the DB tables, deciding what they can or cannot do.
So the actual audit table will have 3 columns (this design may change but for this question it doesn't matter); who (Active Directory User), when (time of addition/deletion/edit), what (what was changed)
My question is how should I be handling this. Ideally I know I should be using a trigger so that it is impossible for the database to be updated without an audit being logged, however I don't know how I could grab the Active Directory User that way. An alternate would be to code it directly into the Access source so that whenever something changes I run an INSERT statement. Obviously that is flawed because if something happens to Access or the database is touched by something else then it will not log the audit.
Any advice, examples or articles that may help me would be greatly appreciated!
Does this work for you?
select user_name(),suser_sname()
Doh! I forgot to escape my code.
Ok, it's working here. I'm seeing my windows credentials when I update my tables. So, I bet we missed a step. Let me put together a 1,2,3 sequence of what I did and maybe we can track down where this is breaking for you.
Create a new MSAccess database (empty)
Click on the tables section
Select external data
Pick ODBC database
Pick Link to the datasource by creating a linked table
Select Machine datasource
Pick New...
System Datasource
Pick SQL Server from the list and click Next, Finish.
Give the new datasource a name and description, and select (local) for the server. Click Next.
Pick "With Windows NT authentication using the network login ID". Click Next.
Check Change the default database to, and pick the DB. Click Next. Click Finish.
Test the datasource.
Pick the table that the Trigger is associated with and click OK.
Open the table in Access and modify one of the entries (the trigger doesn't fire on Insert, just Update)
Select * from your audit table
If you specify SSPI in your connection string to Sql, I think your Windows credentials are provided.
I tried playing with Access a bit to see if I could find a way for you. I think you can specify a new datasource to your SQL table, and select Windows NT Authentication as your connection type.
Sure :)
There should be a section in Access called "External Data" (I'm running a new version of Access, so the menu choice might be different).
Form this there should be an option to specify an ODBC connection.
I get an option to Link to the datasource by creating a linked table.
I then created a Machine datasource. I selected SqlServer from the drop down list. Then when I click Next, I'm prompted for how I want to authenticate.
CREATE TRIGGER testtrigger1
ON testdatatable
AFTER update
AS
BEGIN
INSERT INTO testtable (datecol,usercol1,usercol2) VALUES (getdate(),user_name(),suser_sname());
END
GO
We also have a database system that is used exclusively within the organisation and use Window NT logins. This function returns the current users login name:
CREATE FUNCTION dbo.UserName() RETURNS varchar(50)
AS
BEGIN
RETURN (SELECT nt_username FROM master.dbo.sysprocesses WHERE spid = ##SPID)
END
You can use this function in your triggers.
It should be
select user name(),suser sname()
replace spaces with underscores
you need to connect with integrated security aka trusted connection see (http://www.connectionstrings.com/?carrier=sqlserver)
How many users of the app will there be? Is there possibility of using windows integrated authentication for SQL authentication?
Updated: If you can give each user a SQL login (windows integrated) then you can pickup the logged on user using the SYSTEM_USER function.
My solution would be not to let Access modify the data with linked tables.
I would only create the UI in Access and create an ADO connection to the server using windows authenticated in the connection string. Compile you Access application as dbe to protect the VB code.
I would not issue SQL statement, but I would call stored procedures to perform the changes in the database, and create the audit log entry in an atomic transaction.
The UI (Access) does not need to know the inner works on the server. All it needs to do is request and update/insert/delete using the stored procedures you would create for this purpose. The server should handle the work.
Retrieve a record set with ADO using a view with the hint NOLOCK implemented in the server and cache this data in Access for local display. Or retrieve a single record and lock only that row for editing.
Using linked tables your users will be locking each other.
With ADO connections you will not have the trouble to set ODBCs on every single client.
Create a table to set the server status. You application will check it before any action. you can use it to close the server to the application in case that you need to perform changes or maintenance.
Access is a great tool. But it should only handle its local data and not be allowed to mess with the precious server.