Forum Replies Created
-
AuthorPosts
-
j_ferguson
ModeratorThis is assuming you are using the same file object to read the file in both places and that you are not re-opening the file.
j_ferguson
ModeratorIt depends on how your functions are defined. If they are defined as global definitions in a library then you just have to make sure the name is capitalized and that you are spelling it correctly.
If the function is dynamically defined, you need to keep in mind that functions do not have closure like blocks do in Suneido so you can’t do something like:
a = function() { }
b = function() { a() }
b()If this does not answer your question, consider posting an example of what you are trying to do.
j_ferguson
ModeratorHi Ajith,
It shouldn’t matter when the trigger definition is created. I wonder if there is an error or exception happening that you are not noticing? If this continues to be a problem, you might consider attaching an export of your trigger definition as well a dump of the table the trigger is on.
Thanks.
j_ferguson
ModeratorI also forgot to mention that if you are running client-server and you modify a trigger function, you may have to unload that trigger code on the server so that it re-loads your new code:
ServerEval(‘Unload’, ‘Trigger_tmEmployees’)
Or, you can use a brute-force method of restarting the Suneido server, that works too.
j_ferguson
ModeratorHi Ajith,
I tried the same thing on my copy and it worked even when I was using AccessControl to insert records. My table is a very simple table and I am running suneido.exe standalone.
If you are running client-server, the trigger will be executing on the server side and the Inspect will not work as expected. In that case you could try using SuneidoLog, or writing to a file instead to debug your trigger.
If you are running Suneido standalone, it is possible there is something about your table that is different from the simple one that I set up. Again, writing to a file (you can use the AddFile function for that), or SuneidoLog would be a better option for debugging than using Inspect in your trigger.
I hope this helps you figure it out. If not, with a little more information we should be able to sort it out.
j_ferguson
ModeratorHi Johan,
It is most likely one of two things:
1. Your Access query does not rename the field and you are passing the renamed field name
2. the value may not be encoded properly for the lookupTake a look at AccessControl.AccessGoto method. You will see the Datadict encode is one of the first things that happens. If your datadict does not inherit from Field_num it is possible that it is not being encoded properly for the lookup. You might want to add some Print statements in this method to find out if the lookup queries are doing what you expect.
j_ferguson
ModeratorI have done some more testing and confirmed that some of our applications actually do use KeyControl with number fields and it is working.
One thing to check is that you have the proper datadict class attached to your field and inherit from an appropriate base class that will do the proper encode for the data type you are using. For example, the field that I tested with defined the Control member as a KeyControl, and inherited from Field_number, which will ensure the values get encoded as numbers. When I switched the datadict class to inherit from Field_string, I saw behavior similar to what you described.
j_ferguson
ModeratorLooking at the code for the control, it appears it is trying to handle data types other than string. I will have a closer look and let you know what I find.
j_ferguson
ModeratorHi Ajith,
Look in the User’s Manual under Database > Reference > Transaction, and Database > Reference > Query.
When you do a request like QueryDelete or QueryDo, it is using a brand new transaction even though it isn’t completely apparent. When you do this and the transaction overlaps with your .t transaction you open up opportunity for transaction conflicts. Without getting into all the details about what exactly causes conflicts, I would suggest you try to use the transaction you already have rather that starting new ones to do requests. Again, if you look at the references in the User’s Manual above you will hopefully find methods you can use within the transaction (.t) that you have rather than doing QueryDelete or QueryDo.
Hope that helps
j_ferguson
ModeratorHi Ajith,
That behavior is a bit curious. It looks like it is assuming the one quote is the beginning of the string you are going to set doAdmn to. It seems if you are setting a column to a string in queryview, the last quote is not needed.
If you query the table after the request, you’ll see it is not setting the value properly.
If you want to set the field to a variable date you could use the following:
QueryDo(‘update dengueMaha where dateAdmn = “1.8.13 P” set doAdmn = ‘ $ Display(Date(day:1, month:8, year: 2013)))
If you are just setting to a date constant you can do:
update dengueMaha where dateAdmn = “1.8.13 P” set doAdmn = #20130801
j_ferguson
ModeratorDo you want to do this in one specific place or for your entire application? Making this work globally could be tricky.
If you just need it in one specific place, you could look at LocateControl in stdlib and see how it handles processing the Enter key. It uses SetWindowProc and then handles the window messages in the Enterproc method. You could do something similar. There is a SetFocus function that you could also use to place the focus in the other control as long as you have a window handle.
j_ferguson
ModeratorHello Tahar,
Suneido does not have any built-in replication features for the database (not yet anyway).
There has been some work done on ODBC connections and MySQL interfaces from Suneido. You can find them here:
http://www.suneido.com/support/downloads
Quite a few of the downloads available on the page have not maintained with every release of Suneido therefore some may not work with the current download of Suneido.
One way of doing a backup while Suneido is running is to use the Dump() function. If you call it with no table argument, it makes a dump of the entire database to your current working directory. This type of backup wouldn’t work as a real-time solution since it is dumping the entire database when you call Dump(). Since it is dealing with the entire database it is not something you want to be calling too frequently.
j_ferguson
ModeratorHello Tahar,
There seems to be an issue with the compiled library feature. I am noticing the same issues. We will check into it.
Thanks for reporting this.
j_ferguson
ModeratorIt looks like there might be an issue with storing the compiled code in the libraries currently. I get an error as well when trying to saved the compiled code. We will look into it.
Thank you for reporting this.
j_ferguson
ModeratorHello Tahar,
Sorry for the delayed reply.
The problem is that you are calling Params in your arguments to Window which will already create its own window.
Try either
Params(#(Text “Hello”), ‘pg’, #(Text “Goodbye”))
or
Window(Object(‘Params’ #(Text “Hello”), ‘pg’, #(Text “Goodbye”)))
-
AuthorPosts