I'm going to use this table to keep tracking the history of a certain entity and show to the user. I need to map the AbpAuditLog to an entity or already exist a way to do this?
I want to make queries on this table using Entity Framework. Is it possible?
Related
I have two tables, one has a foreign key to the other. For ease of use let's say I have a table named 'Boy' with a foreign key for iceCreamId to a table called 'IceCream'.
In hasura the only way I can see how to create an entry in IceCream when I insert into boy is through the query.
Is there a way I can trigger a default IceCream insert when a 'Boy' is inserted through the backend? Don't like the frontend being relied on to do this.
Hasura builds on top of the functionality of your database and works best when you embrace all the functionality that the underlying DB has to offer.
This can easily be accomplished using a Database Trigger (I am assuming you're using Postgres here)
Triggers allow you to run additional logic in the backend either for validation or to do create, update, delete etc when records are updated, deleted or created
You can simply use Hasura event triggers
Hasura can be used to create event triggers on tables in the Postgres
database. Event triggers reliably capture events on specified tables
and invoke webhooks to carry out any custom logic.
so, in your case, you can set up a simple event trigger on the create/update of the Boy table, you can then create the IceCream row in your webhook.
The one thing cooler about event triggers is that you can manually invoke/retry the same operation in case of failure!
for more info: Hasura Event triggers
is there any method for inserting new record or update when record exists in database using DB facade ?
Note: there is no model but only a controller , so using model related methods is impossible.my question is regards to query builder
The most straightforward approach is to look into your database's syntax for upserting. It will be different depending on the database and the specific situation, and may require defining a UNIQUE key of some kind.
Here is an example for MySQL:
INSERT INTO table (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
By the way, the more idiomatic approach would be to define a model. Model's allow you to handle this situation more gracefully and (in many cases) prevent you from tying your code to a specific RDBMS.
I would like to create a forms in my Access database which will save data to existing tables. This data entry form will save all valid data to the specified tables.
Now I would like to restrict the table from direct entry, i.e. no one can edit/update data directly in tables.
So please suggest me know can I do this.
You can not make something readonly AND not readonly. The forms need the tables to be writable.
What you can do is hide the tables, see: http://office.microsoft.com/en-gb/access-help/show-or-hide-database-objects-HP005188361.aspx.
If you need the tables for lookups you can make a readonly query based on the table. You have to change the query type to snapshot.
We run two websites, A and B. Each website has its own table, _a_ and _b_ which have exactly the same structure. Yes, I know it's silly, we'll be rewriting them over the course of this year and next.
Using Laravel I need to create a model that will hold both tables content. I don't need any kind of UPDATE or INSERT functionality, I just need to SELECT and use with to access other model information.
Is this possible with Laravel 4.1? I can individually model each table, but that would make it difficult in the future.
I was able to fix this by making using the Repository pattern and merging the results of each model into the get and all functions.
I've made a custom entity that will work as an data modification audit (any entity modified will trigger creating an instance of this entity). So far I have the plugin working fine (tracking old and new versions of properties changed).
I'd like to also keep track of what entity this is related to. At first I added a N:1 from DataHistory to Task (eg.) and I can indeed link back to the original task (via a "new_tasksid" attribute I added to DataHistory).
The problem is every entity I want to log will need a separate attribute id (and an additional entry in the form!)
Looking at how phone, task, etc utilize a "regardingobjectid", this is what I should do. Unfortunately, when I try to add a "dataobjectid" and map it to eg Task and PhoneCall, it complains (on the second save), that the reference needs to be unique. How does the CRM get around this and can I emulate it?
You could create your generic "dataobjectid" field, but make it a text field and store the guid of the object there. You would lose the native grids for looking at the audit records, and you wouldn't be able to join these entities through advanced find, fetch or query expressions, but if that's not important, then you can whip up an ASPX page that displays the audit logs for that record in whatever format you choose and avoid making new relationships for every entity you want to audit.
CRM has a special lookup type that can lookup to many entity types. That functionality isn't available to us customizers, unfortunately. Your best bet is to add each relationship that could be regarding and hide the lookups that aren't in use for this particular entity.