Service Manager / Service Center Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

User Selection fields of service catalog in DB

Super Advisor

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

6 REPLIES
Honored Contributor

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 [Founder]

Re: User Selection fields of service catalog in DB

Hello,

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

Super Advisor

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 [Founder]

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).

Highlighted
Advisor

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

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;
}