Strange Script Issue in Perspective

Hello there,

I am facing this strange behavior in Ignition 8.1 perspective module.

I have a view with custom dataset property. Into the dataset property I am pulling data from DB based on some filters. I have a script library package where I have defined this functions which fires every time my dataset value is changed.

In one the function I have written written in script library package, I am inserting rows into the DB based on selected filter. Now this script firing works fine and it also inserts these rows into DB. Thing is sometimes this works fine and some times it does not. When it does not and for troubleshoot purpose I open that view in the designer, the function gets fired and it inserts data fine. This works fine afterwards for some days and so.

What could be the issue here? Earlier also I have faced this issues which tend to resolve when I just open the script library package and save the project. Please suggest.

You’re going to have to show some code. How your custom dataset property is determined - a binding, from a script, etc.

Show your library package that does the insertion of the rows. If the rows are inserting always in designer but not in a client my guess is you’re getting unexcepted data inputs from the client that aren’t being handled properly in the insert statement or are breaking your insert statement ie someone enters a string for a integer column which will fail an insert.

We can’t tell until you show some more detail.

My custom dataset is pulling data from the binding via named query.

And no extra data is being received from the client since I’m just pulling row from other table and inserting that. I’ve ensured that no extra data insertion is being done. I’ll try to post the code however it’s a really huge code package which linked with some other functions.

Again I’ve endured no other function causing this problem as if it would have caused in the session then it should’ve cause in the designer too.

Maybe the event that responds to changes in your dataset is not firing. If you don’t have any script errors in your logs I would recommend setting a flag when your script is firing to confirm that it was actually called.

I would say the first step is to look in the logs for any errors. The second step would be to confirm that your event is firing when you think it should be. From there I would systematically log information at various points in the processing to see where the process is stopping if it is firing the event but not inserting the record or throwing errors.

I can’t tell exactly what you’re trying to do from what you’ve said but you might want to look into using an expression structure binding to fire your code. That way it will call your script when a parameter’s value changes. That might not work with what you’re trying to do but it’s a good biding type to use when you’re trying to run a script when bound values change.

Not necessarily true. You could be using a function which is outside of Gateway scope, or there could be places where you don't supply the database assuming that the default database will be used, but in a gateway scope you must supply a database.

These are the types of things we can't tell without the script.

2 Likes