Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
892 views

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

Jump to solution

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

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution

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:

1.JPG

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:

2.JPG

Step 3

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

3.JPG

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:

4.JPG

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

View solution in original post

2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

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

Jump to solution

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.

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution

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:

1.JPG

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:

2.JPG

Step 3

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

3.JPG

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:

4.JPG

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

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.