Re: User Selection fields of service catalog in DB (315 Views)
Reply
Super Advisor
Posts: 276
Registered: ‎01-06-2010
Message 1 of 7 (462 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

Honored Contributor
Posts: 989
Registered: ‎02-22-2011
Message 2 of 7 (459 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.

Honored Contributor
Posts: 5,881
Registered: ‎11-10-2008
Message 3 of 7 (456 Views)

Re: User Selection fields of service catalog in DB

Hello,

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

Super Advisor
Posts: 276
Registered: ‎01-06-2010
Message 4 of 7 (445 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

Honored Contributor
Posts: 5,881
Registered: ‎11-10-2008
Message 5 of 7 (442 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).

Advisor
Posts: 19
Registered: ‎04-08-2010
Message 6 of 7 (315 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.
Frequent Advisor
Posts: 42
Registered: ‎02-29-2008
Message 7 of 7 (306 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;
}

 

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.