During many circumstances especially while using web services, we traverse through the property sets to check for different things and take appropriate action. One of those checks could be to check the expected property exists. PropertyExists method in Siebel eScript ensures that the specified property exists in a property set. This is a very useful method. The check is similar to using an if statement after ExecuteQuery() to make sure that it returns at least one record. This PropertyExists method is be used with if statements. This post can also fall under one of the best practices while writing eScript.
Scenario: In the below code I will have the above property set passed as Inputs for Business Service.I will have to check that the child property UsernameToken exists in the given property set otherwise I need to add that. Here is code to check that.
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
if (MethodName == "CheckHeader")
{
if (Inputs.GetChild(0).GetChild(0).PropertyExists("UsernameToken"))
{
//do something or nothing
}
else
{
//add Username Token
}
}
}
I hope this post gives some clear explanation about this property set. Shoot me a comment if you have any questions.
Related posts(Auto Generated):





February 27th, 2009 at 1:14 pm
The reason “PropertyExists” is really useful is that under WSC standard if an XML property has not got allocated a value then the property is removed from the XML message.
Note; this is distinct from a property that has a NULL value, since NULL itself is a value.