I have form with several controls. When I fill these controls all of them are saved correctly in the datasource table except of one realEdit control. It says "Unretrieved" in the table. I have set it's datasource and datafield properties correctly, so what can be a reason of it and how to solve it?
"Unretrieved" fields are newly created fields which AX 2012 AX by error treats badly. It may also appear if a form query does not contain a field in the datasource field list.
You problem is solved by restarting the client or the AOS or both. Or in the second case just add the field to the query field list.
1.- Recompile and restore table. Check fields with Table explorer; if table explorer doesn't show your field(s) properly, certainly ypur form won't do. So, if this fails, goto 3
2.- Recompile and restore form. Generate incremental CIL. Check it. If fail, goto 3
3.- Restart Ax client and retry steps 1+2. If fail, goto 4
4.- Restart AOS. Retry steps 1+2.
Related
I have SQL Server 2008 R2 linked tables in my MS Access 2010.
I have many forms in this MS Access database. Few of my forms gets Write Conflict error when I try to assign it to a SQL statement as record source after I have updated very same record by SQL statement (or assign some values on form programmatically and refreshed the form in module) as I have general function being called every time I enter certain text on one of the field on form and it gets updated some of the forms fields value programmatically.
I have a TIMESTAMP column in my table in SQL Server.
So after updating the fields on the forms, when I try to assign a new record like
Me.Recordsouce = sqlstring , I get a "write conflict" error.
I tried to set on button click before I assign a recordsource
Refresh
Docmd.RunCommand AcCmdSaveRecord
But they all throw the same "Write Conflict" error and asking me to drop changes.
Please help
Many thanks,
Can i alter/intercept the event when updating an entity?
For example, for when i update the company entity?
The idea is to delete somehting in the BBDD after the entity is updated
You can use Table Scripts to run functions when a record is inserted, after a record is inserted, when a record is updated, or when a record is deleted.
Table Scripts use JavaScript, but have access to the server-side functions (such as FindRecord, SQL statements, etc).
So, you can add a Table Script to the Entity to delete a record via a SQL statement when a record is updated.
It's difficult to give you an example without knowing exactly what you're trying to do though.
Six Ticks Support
Users modify a DB object in an edit form that I have, pretty straight forward.
I need to implement a 'change log' on this object. I need to record which fields where changed and what they were before and after. I'm using Razor MVC.
I've done this by writing triggers for the table on update/delete. On update/delete of a record, the trigger pushes the record to a History table, in a History database. This creates the change log. Then you would just need to display it; to identify the change would require evaluating each and every field.
There's nothing already built that wold do this for you that I know of.
I am trying to learn how to create a custom content type programmatically from within my module.
However, after uninstalling and reinstalling my module I was getting an error stating that one or more of the fields I was trying to create could not be created because they already exist.
So I went hacking through my databse, removing the content type and all tables that belonged to it.
Same result -- field already exists.
Next I went to the Drupal API website looking for ways to delete fields and field instances, and came across
field_delete_field()
and
field_delete_instance()
I made a php page to try to delete the fields that I had created, only to get an error stating that the table I was trying to delete does not exist.
So I'm kinda stuck -- I can't create the fields because they already exist, and I can't delete them because they don't exist!
BTW the code I was modeling my module after is the code found in the "node_example" section of the Drupal examples module.
Ouch, deleting the database tables manually is never a good idea - Drupal's not that forgiving :)
Just to address the code in your install/enable hook, wrap the field creation in:
if (!field_info_field('field_name')) {
field_create_field(...
}
That will stop the problem happening again. Or if you don't want to do that, make sure the field is deleted in the uninstall/disable hook. Obviously that method would potentially result in data loss.
To address the current problem, follow this process:
Completely uninstall (not just disable) your custom module. If it's in an inconsistent state, just delete its row in the system table.
Delete all traces of the field from the field_config and field_config_instance tables.
Truncate all the cache tables manually (any table beginning with cache_).
Not strictly necessary but clear up any lingering content:
$nids = db_query('SELECT nid FROM {node} WHERE type = :type', array(':type' => 'type'))->fetchCol();
node_delete_multiple($nids);
That ought to do it.
Any time you delete a field, through the UI or programatically you'll need to either run cron or call field_purge_batch() to 'hard' delete the fields as they're only marked for deletion in the first instance.
I have a page that contains a Gridview showing a record from a db table e.g. "tblEmployee".
If a record is inserted/updated/deleted in that table then I need my page to be reloaded so that the gridview will show the updated records. Records may be inserted/updated/deleted from any other application.
To rebind the gridview I have to reload the page. Suppose I open the page in my browser and no postback is done. After 10 minutes a record is inserted into the table by some other apps. How can I reload the page automatically, not manually by clicking refresh button when the records in db table changed? I am using Sql server 2005 as DB and ASP.Net 3.5(C#)
Please suggest how to implement this.
Thanks.
Here's two approaches... one using a trigger, the other using SqlDependency. I would recommend using SqlDependency, but I'm outlining another approach because you indicated trouble with SqlDependency.
Create a table with columns for table name and last update date. Create a trigger on tblEmployee to update that table on any insert/update/delete.
When the page is loaded, you'll want to store the current last update date for the table. Depending on how your page is setup, you could store it in ViewState or as a hidden field on the page. Then you'll need to poll for changes. There are many ways to do this. You could write a simple Page Method that returns the last update date, call it from JavaScript, and compare it to the date you stored in the hidden field. Or you could use an UpdatePanel with a Timer control and compare to the value you stored in ViewState.
Now this approach hits the database more than necessary. If that's a problem, use SqlDependency with SQL 2005 or greater. Create a SqlDependency and insert the current date into the Cache with this dependency object. Poll this cache item from the page as described above. When the dependency changes (OnChange event), update the cache item date again.
I see not other option that having a polling mechanism, i.e. using setTimeout+jQuery or ASP.NET AJAX Timer that pulls the information at intervals.
Basically what you want is for the server to notify the client that an update has occurred and in a web/ASP.NET application communication is always initiated by the client. So polling is your only option.
You could use the SqlDependency class:
Here's a getting started example: SqlDependency in an ASP.NET Application (ADO.NET)