Moving data from a user selection to a field in the fulfillment record

Hi All,

user want to have  ‘JUSTIFICATION/REASON FOR REQUEST’ from quote ticket in report. I've the guide from hp from not really understand and I can't see the field name from the form design. How to I fill in below expression?

<your.field> in $L.file=jscall("xmlFill.getValue", svc.options in $L.file, “<user selection field>”)

  • I don't know to which doc you're referring to, but I try to give some insight.

    svc.options is the field that holds the user selection information. It's in XML format, so therefore you have to use a JS library function to pick certain value from the XML data.

    First, you've to know which XML tag holds the information you want. I think the best way to is to (temporarily) add a textarea to form and put svc.options as a input field. Save changes and open a quote to locate what kind of XML tags svc.options field holds.

    For example, a tag pair can be like <color>red</color>. In that, case your "<user selection field>" would be "color". More code examples can be found from the table called "svcCatInterface" - check the expressions page for an catalog connector called "Open A Change".

    <your.field> could probably be any (probably array) field you think is appropriate to be used.

  • Verified Answer

    Hi

    Below are the step I did while to capture the user options in incidents table

    Step 1:

    create a script in script library by name : setoptions1 as shown below:

    Script is :

    function getValue( xmlString, id )

    {

          var xml = new XML();

         

          //print ("data=" xmlstring "-" id)

          //print ("cond=" xml.setContent( xmlString ))

          if ( xml.setContent( xmlString ) );

          {

                var element = lib.xmlHelpers.getElement( xml, id, "id" );

                if ( element == null )

                      return null;

                var value = element.getValue();

               

                return value;

          }

         

    }

    Step 2 :

    create the fields in incidents table so that the value can be captured from user options in those customize fields, in my case below are the fields that I created:

    Step 3

    Navigate to fc of incidents & type in the following expressions:

    zcountry in $file=nullsub(jscall("setoptions1.getValue", svc.options in $file, "Country"), 0)

    zlocation in $file=nullsub(jscall("setoptions1.getValue", svc.options in $file, "Location"), 0)

    zcity in $file=nullsub(jscall("setoptions1.getValue", svc.options in $file, "City"), 0)

    zstreet in $file=nullsub(jscall("setoptions1.getValue", svc.options in $file, "Street"), 0)

    zbelongto in $file=nullsub(jscall("setoptions1.getValue", svc.options in $file, "Belong"), 0)

    Step 4

    Go to the desired Catalog Items & create the user options which are to be captured:

    Above steps will copy the user selections to the customised fields in incidents.

    In your case you want to copy the user selection on Request, you can follow the above steps for request as well else place the fields in incidents & copy those fields in ocmq through screlate.incidents.ocmq.svc link record.

    Have attached the document for your further understanding.

    Regards

    Neo