[Imported] ValidateConfiguration method for CDBObject
EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send InviteCancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-11-0501:57 PM. Last Modified: 2023-05-0312:33 AM
[Imported] ValidateConfiguration method for CDBObject
>>Message imported from previous forum - Category:Scripts and Tips<< User: mchartrand, originally posted: 2018-10-25 19:13:28 Id:275 This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.
_______
**_Von: Hey all: What is the intended use for ValidateConfiguration? To "Save" an object? I tried calling the method in script and it doesn't do anything.._**
The description there seems to cover it. ValidateConfiguration Validate Configuration Validates the configuration of the object and returns an array of error strings. Control
[retval] Errors (Array of String) : An array of returned error strings.
So if there is nothing wrong with an objects configuration, then it should return nothing or an empty array.
___________________________
**_Von: I should clarify: my subroutine exits as soon as this method gets called, when it still has a list of objects to loop through._**
_____________
AWoodland: Do you have any error handling set in your script (i.e. On Error Goto Something), it may be throwing a runtime error and redirecting you elsewhere.
___________________
bevanweiss: As Adam said, we need more information. If you can provide us a excerpt of your code it will help
______________
**_Von: Thanks for the replies everyone. The code is real simple:_**
**_and I have a MSGBOX just before this line to ensure the object is correct._**
_________
dmercer: I just tried this myself and got it to work. There is a folder called "Test script" which contains a DNP3 binary input called "New Binary Input Point". Below is the script.
_Public Function TestValidate Dim oErrorArray Dim oPoint Set oPoint = Server.FindObject("Test script.New Binary Input Point") If Not (oPoint Is Nothing) Then oErrorArray = oPoint.Interface.ValidateConfiguration End If End Function_
___________________________
bevanweiss: Given that your sample code doesn't appear to show any looping... I suspect the problem is that you aren't performing any looping 😉
If you are expecting it to perform this action for each object in some list of objects you have, you will need to supply more code... like where you create that list of objects, and how you are looping through those objects.
oMyObject is a single DBObject object... if you are passing in a CGroup object then you should expect the ValidateConfiguration result to be incredibly boring... there's not much that can go wrong with CGroup configuration (apart from Redirection List stuff).
If you want to validate the configuration of every object within a CGroup instead... well then you need to do either iteration / recursion to visit each object and call this method explicitly on each.
________________________
dmercer: The sample code that I wrote was just to check the concept and to give Von something to compare to, because it sounds like something in his version is causing it to throw an error and terminate. I was just checking the result via the debugger.
_______________________________
**_Von: Also, I'm trying to perform this method on "broken" cdatasetrows ( If you go "Display Data" on these rows, a "Fail to get data" query error that can be fixed by re-saving this row) - too bad there is no error log to view for vbscript subroutines..._**
_______
bevanweiss: Dean: I did mean the 'sample code' that Von supplied
Von: So how are you looping through all the individual data set rows? That's where the actual Configuration Errors are held... so you'd need to iterate through each one to identify these errors.