Jithisha Respected Contributor.
Respected Contributor.
280 views

Record not getting imported

Hi Experts,

Each source field is separated using tab. I have replaced new line with special character (*@$@*) in  “Note History” field. And while importing this special character will get replaced with new line. Below is the JavaScript condition which I gave in Advance Tab of Import Wizard to replace special character with \n.

target['action']=source['Notes History'].split("*@$@*");

ImportDiscriptor.JPG

But record with 1234567091 is not getting processed due to content in Note history field. Rest records got processed.

Below is the content in Note history field which is having issue.

  *@$@*     *****     CDAX NOTES HISTORY  6/10/2018 11:13:21 PM Pacific Standard Time     *****     Log Type : Notes Log *@$@* Action Type : Inbound Customer call *@$@* Visible Externally : Yes *@$@* From: Uribe, Eduardo  *@$@* Sent: viernes, 8 de junio de 2018 09:01 a. m. *@$@* To: Dispatch IHPS <dispatchihps@hp.com>; Underwood, Chris <christopher.underwood@hp.com>; Spulnik, Jeannie <jeannie.spulnik1@hp.com> *@$@* Subject: Case <#> New Case Creation *@$@*  *@$@* Hi Dear T0,  *@$@* Please open a new case on my behalf with the following details: *@$@*     *@$@*                     *@$@*   GSS PWP FSE Case Request form for dispatching V3.1           *@$@*              *@$@*   Is it a new case creation? Yes               *@$@*   PWP Press Name (Asset Tag) : rs27 HP Serial Number             *@$@*   Activity Type : Break/Fix DE1642M100             *@$@*   Priority : 3 - Normal Customer             *@$@*   Issue Description : Main Dryer Emitter zone 30 fault Georgia Pacific Corp             *@$@*   Symptom Code (Top Category): Graphics Printing (PWP-Press)               *@$@*   Symptom Code (Sub Category): Experiencing KBA Issue               *@$@*   Symtom Code (Specific Symptom): CNF: Experiencing Experiencing KBA Issue               *@$@*   Work Order Needed : Yes               *@$@*   From (MM/DD/YY) : 6/8/2018 Work Orders (1 per day)             *@$@*   Till (MM/DD/YY) :   1 PressSubCategory           *@$@*   Request in the name of, email address : eduardo.uribe@hp.com *@$@*   KBA           *@$@*                     *@$@*   Parts Order           *@$@*   SAP Part number Description Priority Quantity           *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*   MS Dynamics Case Set-Up           *@$@*   Case Type OTC Code Approver Incident Type           *@$@*   Service Delivery By Entitlement Pre Approved Break fix-UN-AMS-graphics           *@$@*                     *@$@*   Case Notes/Approval - To be added in Dynamics           *@$@*   While running 110" press fails for Print Engine Module. Main Dryer. IR. Zone 30. We have replaced the emitter on Zone 30 eventhough the previuos emitter didn't have any sign of burn out connectors or filament. Still the press fails for Emitter 30. We have bypassed this zone, but we still need to find out why does it fail on this zone. We would like instructions on what else to test and procedures.            *@$@*              *@$@*              *@$@*              *@$@*              *@$@*              *@$@*              *@$@*              *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*                     *@$@*           *@$@* Thanks and Regards *@$@* FSE *@$@* Jun 08 2018 09:04:24 GMT-0500  Isaac Lopez HPCS_BOI_AMR EndTS__      #####     

Could you please suggest a way to resolve this issue.

 

Thanks & Regards,

Jithisha

0 Likes
6 Replies
Jithisha Respected Contributor.
Respected Contributor.

Re: Record not getting imported

Hi Experts,

If I specify all source column under fields tab of import descriptor then split function will work but all records are not getting imported.

Below image shows the same.

withsourcecolumn.JPG

If I don’t specify source column, then all records gets imported but split function won’t work.

Below image shows the same.

withoutsourcecolumn.JPG

Could you please suggest a way so that both split as well as all records gets imported and work successfully?

Thanks & Regards,

Jithisha

0 Likes
Acclaimed Contributor.. Jacob Heubner Acclaimed Contributor..
Acclaimed Contributor..

Re: Record not getting imported

I'd use your formatctrl for the import to peform the split.

In the javascript tab of your formatctrl record, write your function to regex replace your special characters with your newline

0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: Record not getting imported

Hi Jacob Heubner,

Below is the JavaScript which I wrote under JavaScript tab of import descriptor.

function SplitSpecialChar(num,notesHistory,Tier3Desc)
{
var file = new SCFile("probsummary");
var rc = file.doSelect('number="num"');
if (rc == RC_SUCCESS)
{
if(notesHistory!=null)
{
installFile.action=notesHistory.split("$*@*$");
}
else
{
installFile.action=string.empty;
}
if(Tier3Desc!=null)
{
installFile.tier3_cdaxdescription=Tier3Desc.split("$*@*$");
}
else
{
installFile.tier3_cdaxdescription=string.empty;
}
file.doAction("save");
}
else
{
print("JS testFC.test():Select of incident failed! ");
}
}

How to call this JavaScript function from format controller?

Thanks & Regards,

Jithisha

0 Likes
Acclaimed Contributor.. Jacob Heubner Acclaimed Contributor..
Acclaimed Contributor..

Re: Record not getting imported

Wow... you're making that a lot more complicated than it needs to be.

From looking at your code, what you seem to be doing is running your import, then running a javascript that basically searches for the Incident record you just imported, and then does your data manipulation as a second step.  You don't need to do that.

Let's say you use your $*@*$ as your split.  You have the Description field populated with data, and you want a new line every time you run into $*@*$

In the formatctrl you're using in your import (from the screenshot, it looks like you've got one named WPProbsummaryLoadOpenCases), in the javascript tab of that formatctlr record, put the following:

Add: not null(action in $file) and index("$*@*$", action in $file)>0
Updte: not null(action in $file) and index($*@*$", action in $file)>0
Javascript&colon; 
     res = record.action[0].split("$*@*$)
     record.action = res

What that does - when your Text Import runs, the system will take the data that is in that import and pass that data through your formatctrl record.  That javascript code will look at the 'action' field - the field that actually stores the Description data - and look at the first line of that Description.  It will break that data up into several lines, with a new line each time it hits your character string.

I'm not quite clear on all the fields you're trying to do this to - looks like you may have a custom field 'tier3.cdaxdescription' as well?  If so, then you'd have another entry in your javascript like -

Add: not null(tier3.cdaxdescription in $file) and index("$*@*$", tier3.cdaxdescription)>0
Update: not null(tier3.cdaxdescription in $file) and index("$*@*$", tier3.cdaxdescription)>0
Javascript - 
    res = record.tier3_cdaxdescription[0].split("$*@*$")
    record.tier3_cdaxdescription = res

Hopefully this will give you enough to get you started.

0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: Record not getting imported

Hi Jacob Heublner,

Thanks for the reply.

Did the specified changes in FC. Below screen shot shows the same. 

js.JPG

But after importing i could see those special characters in description text box(action field). I think split did not work.

Capture.JPG

Could you please suggest a solution.

Thanks & Regards,

Jithisha

 

 

0 Likes
Jithisha Respected Contributor.
Respected Contributor.

Re: Record not getting imported

Hi Jacob Heublner,

 In the javascript tab of that formatctlr record, gave the following conditions:

Add: true

Update: true

Javascript&colon;

res = record.action[0].split("$*@*$");

record.action = res;

 

Now split worked. But when the data from the import descriptor is empty,after importing description textbox(action field) should show as empty.But its showing the previos value. How to make that value empty?

Thanks & Regadrs,

Jithisha

0 Likes
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.