Siebel Tools >  How to find a system Preference Value with eScript

How to find a system Preference Value with eScript

You can create it as a Function as below, or run the code without functions.

Here the example tries to find the Value of System Preference called 'File Attribute'.

 

function FindSystemPreference()

{

try

     {

           var myBusinessObject:BusObject = TheApplication().GetBusObject("System Preferences");

           var myBusinessComp:BusComp = myBusinessObject.GetBusComp("System Preferences");

           var sysPrefName:chars = "";

           var sysPrefValue:chars = "";

           var sSysPref:chars = "";

            with (myBusinessComp)

            {

                     ActivateField("Value");

                      ClearToQuery();

                       //Find the value of System Preference File Attribute

                       SetSearchSpec("Name", "File Attribute");

                        //if you want to find all use SetSearchSpec("Name", "*");

                      ExecuteQuery(ForwardOnly);

                       if (FirstRecord())

                          {

                              do

                                   {

                                          sysPrefName = GetFieldValue("Name");

                                           sysPrefValue = GetFieldValue("Value");

                                           TheApplication().SetProfileAttr(sSysPref, sysPrefValue);

                                     }

                              while (NextRecord());

                          }

                        }

             }

                 catch (e)

                    {

                       throw (e);

                      }

             finally

                 {

                       myBusinessComp = null;

                       myBusinessObject = null;

                  }

         }