Creating SearchSpecs in Siebel
Not too sure if you ever faced it, but at one time I found it really difficult to build siebel searchspecs. I had to copy already built searchspecs and manipulate it to cater to my needs.. :).
However recently I figured out it's not that difficult to build these specs. In general if you are not using a process property (in a workflow) or a function (like LookupValue) searchspec is pretty straight forward. The below is an example.
'[Status]='"In Progress"' (In progress within double quotes and the whole statement within single quotes, the vice versa is also okay, but make sure you use one particular quotes within the statement)
If you need two fields in the searchspec and it will look like below:
'[Status]="In Progress" and [Type]="Administrative"' and so on and so forth. Simple right.
Now comes the little difficult part, when you have a process property or a function,
e.g. '[Status]="In Progress" and [Type]="'+LookupValue("CASE_TYPE","Administrative")+'" and [Sub Type]="'+[&CaseSubType]+'"'
First time when I saw expressions like this I had no clue what's happening. However later on I realized it's just a concatenation of strings with funtions and process properties. To build searchspecs like this you can take the below approach.
1. Note down your searchspec in a plain language.
[Status]="In Progress" and [Type]="LookupValue("CASE_TYPE","Administrative")" and [Sub Type]="[&CaseSubType]"
Note that I have kept the function and the process property also within double quotes, because that's how it will look like if you had the values of them.
2. In the above form Siebel will treat the function and the process property as strings. So we will need to separate them out and concatenate with the rest. So essentially I will split the above function to separate out strings, functions and process properties.
1. [Status]="In Progress" and [Type]="
2. LookupValue("CASE_TYPE","Admisitrative")
3. " and [Sub Type]="
4. [&CaseSubType]
5. "
Here 1, 3 and 5 are strings and 2 and 4 are function and process property respectively.
Now keep the strings within single quotes to signify them as one single string and concatenate with the rest.
' [Status]="In Progress" and [Type]=" ' + LookupValue("CASE_TYPE","Administrative") + ' " and [Sub Type]=" ' + [&CaseSubType] + ' " '
and that's it you are done. Now I really enjoy building complex searchspecs and hope you too will. Put a comment if you are still finding it difficult and I will try to explain more.
Comments
The way you explain its good but i want more clarification on this,please explain it in a more simpler manner..Thank you..