Symptoms
I am trying to understand what the SMO tester is checking when I click on the ] button to expand the list of methods.
Somehow, the SMO tester is checking for something and concludes that the SMO is invalid.
Checking in the SmO tester, a few smartobjects have been found with a red X.
How can we programmatically check if SmartObjects are valid
Diagnoses
Since Smart Forms is not very explicit about what smo is corrupt, I am trying to approach the issue from another angle:
1- Get the list of all the smo in a system (OK)
2- Check them all one by one (performance is not an issue) (That´s where I need help)
3- Report the list of broken SMO (OK)
I do have a piece of code that can loop thru the smos, now I would like to understand what the smo tester does before it concludes it should flag the smo with this red X.
Resolution
The following code is an example of what can be used.
SmartObjectExplorer smartObjectExplorer = smoServer.GetSmartObjects()
foreach (SmartObjectInfo smartObjectInfo in smartObjectExplorer.SmartObjects)
{
if (smartObjectInfo.Metadata.DisplayName != "Process Information")
{
Console.WriteLine("SMO Name: " smartObjectInfo.Metadata.DisplayName)
SmartObjectDefinition SmartObjectDef = SmartObjectDefinition.Create(smoServer.GetSmartObjectDefinition(false, smartObjectInfo.Guid))
if (SmartObjectDef.Inconsistent)
{
Console.Write("SmartObject Name: " smartObjectInfo.Metadata.DisplayName)
Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine(" Inconsistent")
Console.ForegroundColor = ConsoleColor.Gray
}
}
}
Console.WriteLine("PRESS ANY KEY TO CONTINUE...")
Console.ReadLine()
}