SugarCE : How to update a table field based on a changing time condition - sugarcrm

I use SugarCE v 6.5.4 . I need to update the status of a database table field based on the
time condition in database table data . Check every 5 minutes for condition and if met Update status of table . How it can done ? please reply me with a solution.
Thanks,
Anes

You can join your suagrcrm DATABASE from the as400 or main tables with directly pass values in the any mySQL database.
Or another way to update manually from IMPORT in PHPMYADMIN.

You should set up a scheduler thats runs every 5min and that does the query and action you want. take a look at http://developers.sugarcrm.com/wordpress/2012/09/07/adding-your-own-reoccuring-jobs-to-the-scheduler/

Related

Loop through database ANYLOGIC

In my model I want to loop through the database which contains multiple columns (see example) by an event. The idea behind it is that I want to create dynamic events based on the rows in the database.
But I've no clue how to iterate through a database in anylogic and also was not able to find an example of a loop with a database.
The dummycode of my problem would look something like this:
For order in orderdatabase:
Create order based on (order.name, order.quantity, order.arrivaltime, order.deliverylocation)
Where order in the loop is every row of the database, and the value on which the creation is based based on the different column values of that specific row.
Can somebody give me a simple example of how to create such a loop for this specific problem.
Thanks in advance.
Use the database query wizard:
put your cursor into a code field
this will allow you to open the database wizard
select what you need (in your case, you want the "iterate over returned rows and do something" option
Click ok
adjust the dummy code to make it do what you want
For details and examples, check the example models and the AnyLogic help, explaining all options in detail.

iSQLOutput - Update only Selected columns

My flow is simple and I am just reading a raw file into a SQL table.
At times the raw file contains data corresponding to existing records. I do not want to insert a new record in that case and would only want to update the existing record in the SQL table. The challenge is, there is a 'record creation date' column which I initialize at the time of record creation. The update operation overwrites that column too. I just want to avoid overwriting that column, while updating the other columns from the information coming from the raw file.
So far I am having no idea about how to do that. Could someone make a recommendation?
I defaulted the creation column to auto-populate in the SQL database itself. And I changed my flow to just update the remaining records. Talend job is now not touching that column. Problem solved.
Yet another reminder of 'Simplification is underrated'. :)

Take a record to update and let no other update take and update that record during the process

I'm using Entity Framework to develop a website.
The problem I'm having here is a client select 1 record and update it, but if there is another client running the same select query the db will return the same record selected before and rewrite.
How do I avoid this? Is there anyway I can select a record and let no other touch that record?
How do I avoid this. Is there anyway I can select a record and let no other touch that record?
You need to implmenent concurency management :
your table must have a row version column. When users query the data you send row version along the data.
each update from your user must include the row version.
if the row version is different with the current value stored in the database then you throw an exception.
if the row version is same with the one stored in your table then update the data and regenerate the row version column.
Entity Framework make it easy to handle concurrency just take a look at this tutorial. It will help you a lot.

oracle form ''you cannot update this record''

I have a procedure in which I get values from different tables and calculate a certain decimal number. After that i try to post it on a form text-field which is a database item (update and insert allowed on the settings of block and item). everything works fine but the result wont show on the item and won't save in the database field. I get the error
"you cannot update this record".
Can someone help? i have been working on it for two days now and can't find anything.
Did you check if your user has update access on the table?
Check also if there are database triggers on the table that prevents you from updating the record.

SqlDataAdapter Update

Can any one help me why this error occurs when i update using sqlDataadapter with join query
Dynamic SQL generation is not supported against multiple base tables.
You have a "join" in your main query for your dataset (The first one in the TableAdapter with a check by it). You can't automatically generate insert/update/delete logic for a TableAdapter when the main query has multiple tables referenced in the query via a join. The designer isn't smart enough to figure out which table you want to send updates to in that case, that is why you get the error message.
Solution. Ensure that your main query only references the table you want the designer to write insert/update/delete code for. Your secondary queries may reference as many tables as you want.
It was in the case that i was trying to set value for identity column in my datarow. Simply i deleted the code to set value for identity column and it will work.
My Scenario:
Database:
uin [primary, identity]
name
address
Whenever i tried to set the datarow("uin") the error occurs. But works fine with datarow("name") and datarow("address").
Hope it works for you too