Garcia, Jorge
2009-02-05T17:51:00Z
Hello, I´m testing Genius Connect for an aplication between MySQL and Outlook 2003.

I apologize in advance in case someone has already answered the question that I am about to post, but I don't seem to find an answer for it.

I have a MySQL Database whith a field called "privilegios" which has an integer value which corresponds with each user of that DB.

I´ve set a filter row "privilegios=8" to identify a specific computer so that when loading the records it only retrieves the ones onwed by that user.

This works fine but I am having problems inserting or updating the records owned by that user in my MySQL database. I mean, I want to set a default value por that "privilegios" field.

I can do it by creating a "user defined field" in outlo and setting it to 8. However I do not know how to make this new field a default field so that everytime the user creates a new contact this field appears set to 8 by default.

I´ve also tried to set a mandatory key like this: "update contactos set privilegios=8" but this updates ALL the records in my database.

Which is de most easy way to do this?

Thanks in advance
Sponsor
GeniusConnect documentation search (User Manual Downloads...)
Administrator
2009-02-05T18:12:00Z
You don't have to create a user define field.

Go to Mandatory Keys dialog and add your field as mandatory with SQL Statement like this:
select 8 (for integer datatype)
select '8' (for varchar)

If you have link between for example NT user and the privileges table in your DB, you can also use a dynamic statement like this:
select privileges from MyPrivileges where NTUser='{WINDOWS_NT_USER}'
(see Filter Rows Help topic for possible params)


GeniusConnect will run your SQL Statement
select 8
before insert, and the result value (8) will be inserted in your DB in field "privilegios"