Re: User Selection fields of service catalog in DB (222 Views)
Reply
Super Advisor
Mushi
Posts: 276
Registered: ‎01-06-2010
Message 1 of 7 (369 Views)

User Selection fields of service catalog in DB

Hello Experts

 

I just want to know that where SM stores the user selectable fields (which we can add on catalog item) in DB. And we can access it and see the data of it.

 

Thanks

Please use plain text.
Honored Contributor
-m-
Posts: 989
Registered: ‎02-22-2011
Message 2 of 7 (366 Views)

Re: User Selection fields of service catalog in DB

The "option" fields (e.g. options, option.validations) in svcCatalog records store the XML generated from the User Selections wizards.

Please use plain text.
Honored Contributor
Vadim Gorda
Posts: 5,685
Registered: ‎11-10-2008
Message 3 of 7 (363 Views)

Re: User Selection fields of service catalog in DB

Hello,

In the further generated objects (Interaction, change ...) it is svc.options field.

Please use plain text.
Super Advisor
Mushi
Posts: 276
Registered: ‎01-06-2010
Message 4 of 7 (352 Views)

Re: User Selection fields of service catalog in DB

Hello Guys

 

Sorry i believe i havnt explained my query properly. Actually i want to know the data which end user enters while raising a request or change inwhich table SM stores this end user data?

 

Thanks

Please use plain text.
Honored Contributor
Vadim Gorda
Posts: 5,685
Registered: ‎11-10-2008
Message 5 of 7 (349 Views)

Re: User Selection fields of service catalog in DB

Hello Mushi,

Maybe i still don't undersatnd what do you mean, but if person is raising a change (from interaction?) then the data will be saved in cm3r table (change table) or in incidents table (If it was Interaction initially). For request it is ocmq (quote).

Please use plain text.
Advisor
ZiggyPopp
Posts: 19
Registered: ‎04-08-2010
Message 6 of 7 (222 Views)

Re: User Selection fields of service catalog in DB

To access the values, you have to write some java script to parse the data out. You can place code in the svcCatInterface record to parse the data and then write it to a DB field as well. This is more complicated as you need to add the fields to the ocmq, ocml and the ocml.copy.quote link to get the data written into your line items.
Please use plain text.
Frequent Advisor
MarjanP
Posts: 42
Registered: ‎02-29-2008
Message 7 of 7 (213 Views)

Re: User Selection fields of service catalog in DB

[ Edited ]

Hi.

 

Here is a simple script that can be called (jscall) practically anywhere to get or check User Selection. The script has testing procedure that has to be commented or deleted after testing.

 

Regards, Marjan

 

 

checkUserSelection

 

// ****** Testing procedure ***********************************************************************

var quote="Q1079";      // Change Quote number according to actual quote tested
var testAttribute = "service";  // Change attribute acording to User Selection definition
var testValue   = "new";  // Change attribute value acording to User Selection definition

var quoteRec = new SCFile("ocmq");
var query   = "number=\""+quote+"\"";
var rc    = quoteRec.doSelect(query);

if (rc == RC_SUCCESS)
{
 print(checkAttributeValue(quoteRec.svc_options, testAttribute, testValue));  // should return true/falase
 print(checkAttributeValue(quoteRec.svc_options, testAttribute));    // should retun attribute value
}
// *************************************************************************************************

 

 

// **************************************************************************************************************************
// * This function will check/return value of attribut in "svc.options"
// *
// * svcOptions - svc.options field value ... XML string
// * attribute - attribute name
// *
// * checking the value of attribute:
// *
// *  jscall("checkUserSelection.checkAttributeValue", svc.options in $L.file, "attribute name", attribute value")
// *
// * geting he value of attribute:
// *
// *  jscall("checkUserSelection.checkAttributeValue", svc.options in $L.file, "attribute name")
// *
// ***************************************************************************************************************************

function checkAttributeValue(options, attribute, value)
{

 if (value == null)
  var retVal = "";  // Set default return value if asking for attribute value
 else
  var retVal = false;  // Set default return value if checking attribute value
  
 if (options != null && attribute != null)
 {
  var optionXML  = new XML();

  optionXML = optionXML.setContent(options);
 
  var node = optionXML.getFirstChildElement();
 
  while (node != null)  // Check all attributes in option XML
  {
   if (node.getFirstAttribute().getValue() == attribute)
   {
    if (value != null)
    {
     if (node.getValue() == value) retVal = true;
    } 
    else retVal = node.getValue();
   }
     
   node = node.getNextSiblingElement();
  }
 }

 return retVal;
}

 

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation