Custom script in RPO making empty columns in the line items during the training.

Hello friends,

its URGENT! need help.

We have a requirement of the company in the case of the currency 'EUR', it should delete the dot (.) and replace the comma (,) with dot (.) and other currencies it must remove the comma from columns, quantity, price per unit and Total.

For example:

For "EUR" 2.123,00 and it must convert it to 2123.00 and 2.123 must convert 2123.

"USD" 2.123,00 to convert to 2.12300 and 2 123 to convert to 2123.

This requirement, we wrote a custom script User Exit (UserExitLineItemValidate) function and call that function in line item validation.

but after having formed the invoices for currency 'EUR' by supervised and learning check (SLV), it removes the values in the column quantity, unit price and Total.

and if we remove the script, train and then reapply custom script it works but not always.

My Script:

Public Sub UserExitLineItemsValidate (pWorkdoc As SCBCdrPROJLib.SCBCdrWorkdoc, pValid As Boolean)

' User exit is called at the end of the Document_Validate on the class "bills".

Dim strQuantity As String

Dim strUnitPrice As String

Dim strTotal As String

Dim lngRow As Long

Dim pTable As SCBCdrTable

Set pTable = pWorkdoc.Fields ("LineItems"). Table (pWorkdoc.Fields("LineItems"). ActiveTableIndex)

If fnIsVerifier and pWorkdoc.Fields ("Currency"). Text = "EUR" Then

For lngRow = 0 To pTable.RowCount - 1


strUnitPrice = pTable.CellText ("unit price", lngRow)

If InStr (strUnitPrice, ".") > 0 and InStr (strUnitPrice, ",") > 0 Then

strUnitPrice = Replace(strUnitPrice,".","")

strUnitPrice = Replace(strUnitPrice,",",".")

pTable.CellText ("unit price", lngRow) = strUnitPrice

ElseIf InStr (strUnitPrice, ",") > 0 Then

strUnitPrice = Replace(strUnitPrice,",",".")

pTable.CellText ("unit price", lngRow) = strUnitPrice

End If

strTotal = pTable.CellText ('Total', lngRow)

If InStr (strTotal, ".") > 0 and InStr (strTotal, ",") > 0 Then

strTotal = Replace(strTotal,".","")

strTotal = Replace(strTotal,",",".")

pTable.CellText ('Total', lngRow) = strTotal

ElseIf InStr (strTotal, ",") > 0 Then

strTotal = Replace(strTotal,",",".")

pTable.CellText ('Total', lngRow) = strTotal

End If

strQuantity = pTable.CellText ("quantity", lngRow)

If InStr (strQuantity, ".") > 0 Then

strQuantity = Replace(strQuantity,".","")

End If

If InStr (strQuantity, ",") > 0 Then

strQuantity = Replace(strQuantity,",",".")

End If

pTable.CellText ("quantity", lngRow) = strQuantity

Next LngRow

On the other

For lngRow = 0 To pTable.RowCount - 1

strTotal = pTable.CellText ('Total', lngRow)

If InStr (strTotal, ",") > 0 Then

strTotal = Replace(strTotal,",","")

pTable.CellText ('Total', lngRow) = strTotal

End If

strUnitPrice = pTable.CellText ("unit price", lngRow)

If InStr (strUnitPrice, ",") > 0 Then

strUnitPrice = Replace(strUnitPrice,",","")

pTable.CellText ("unit price", lngRow) = strUnitPrice

End If

Next LngRow

End If

End Sub

At a very high level of control, (and I can't currently that take a long time to respond)

  • You do this on EVERY invoice, and not only those that you are sub classification (which means "documents that you are training").  Is your intention to assign all invoices or only those formed?
  • In your code, you have the test as shown condition "If fnIsVerifier and pWorkdoc.Fields("Currency").» Text = "EUR" Then".»  You are in essence saying the system ONLY evaluate this condition if the system determines if the application Verifier is running.  What is the desired effect?  Otherwise if the auditor is never used on this document, and the table of line items is never changed, this code would never trigger.

Tags: Fusion Middleware

Similar Questions

  • Fill two empty columns with the values in a column (all in the same table)

    Can someone point me in the right direction? I want to fill the column prefix and suffix with the AcctNum data.

    "Prefix is the part of the number before the '-' and the suffix is everything after the '-'. '. Write a SQL command to fill the column prefix and suffix.
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    It is supposed to look like this:
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097    123     0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    That's what I came with, but it does not work because it is basically putting multiple values into a single cell:
    update accounts
         set prefix=(select substr(acctnum, 1, instr(acctnum,'-')-1) from accounts),
         suffix=(select substr(acctnum, instr(acctnum, '-')+1) from accounts)
         where acctnum=(select prefix||'-'||suffix from accounts);
    I want this query is incredibly easy and I have forget something. Any help is greatly appreciated.

    Published by: 885913 on September 18, 2011 12:53
    UPDATE accounts a
    SET    ( prefix, suffix ) = (SELECT Substr(acctnum, 1, Instr(acctnum, '-') - 1),
                                        Substr(acctnum, Instr(acctnum, '-') + 1)
                                 FROM   accounts b
                                 WHERE  a.acctnum = b.acctnum);
    
  • fdmContext in a custom script

    Hello everyone,

    I'm faced with a problem on a custom in FDMEE script.

    I have a custom jython script that calls an ODI scenario. My problem is how to move the POV selected in fdm to the ODI scenario? I need to get information from the period inside my ODI package.

    POV_Selected.PNG

    How can I achieve this?

    Thank you very much!!!

    Best regards

    Eduardo Almeida

    Your other question is that fdmContext will not be initialized in a custom script. If you need to get the FDMEE period in the scenario ODI, you must configure a custom script parameter that evaluates to FDMEE period POV as input that you can then recover in your script that is customized by using the following API - fdmAPI.getCustomScriptParameterValue ("ParameterName")

    You'd then this value as a variable argument to the ODI scenario

  • for-each@cell inserts an extra empty column

    HI Experts,
    I use for-each@cell to be able to display columns of a report in excel. But this sentence, inserts an extra empty column in the report. Is it possible to get rid of this empty column.

    Thank you
    Swarna

    You can have so that it ignores the empty columns

  • Add empty columns

    Hello world
    I would add 2 empty columns in the report.
    If anyone knows, please he us.

    Thank you

    Gasket! Seagull

    Hello
    To add the column Empyt, first run a print layout.

    Tool
    Model Editor
    Select A
    Click on any place you want to put
    Type Colum
    You can see below:
    http://nycapex.blogspot.com/2010/03/add-empty.html

    If you have any questions, please report it.

    Please check correct/useful if it is

  • Sort sort the columns number of lines n columns in the RTF PivotTable but hide them.

    Hello

    I'm trying to sort on the columns number of sort for lines n columns in the PivotTable but hide them. Any help appreciated.

    Attached model RTF, XML and output required. Thank you

    Please check your email that I have forwarded to update the model.

    by default, it performs a sort on the column, we used to pivot rows and columns. If we need custom sort, we must specify that column in the logic that was present in the C form field.

    by default, you are as below

    Custom sort

    {INDUSTRY_sort, o = a, t = n} « ; » MONTHS {Month_sort, o = a, t = n} '; SALES '; "' sum '? >

  • Error: Import module XLRD in a custom script FDMEE

    Hello Experts,

    I'm trying to import a python "xlrd" module in a custom Script FDMEE. But he doesn't always lift error "No Module name xlrd".

    I tried to import the module by changing the path sys:

    Here is the code I tried:

    ===========================================================================================

    import sys

    "custModlePath = r'fdmContext ["INBOXDIR"] +"\\Excel_Sample\\xlrd""

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\."

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out."

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    #data_sheet = book.sheet_by_index (3)

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\mapping.csv",'w")

    #myfile = open('SG\OUT\mapping.txt','w')

    all in start_row_count < end_row_count:

    #print data_sheet.row_values (i)

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =============================================================================================

    ERROR:

    2016-01-27 01:18:11, 294 FATAL [AIF]: error in CommProcess.executeCustomScript

    Traceback (most recent call changed):

    File "< string >", line 191, in executeCustomScript

    File '< string >", line 486, in executeCustomScript

    Folder "< string >", line 528, in executeJythonScript

    File "E:\FDMEE/data/scripts/custom/EXCEL_TO_CSV.py", line 6, < module >

    import xlrd

    ImportError: No module named xlrd

    2016-01-27 01:18:11, 336 DEBUG [AIF]: the connection of fdmAPI was closed.

    ===========================================================================================

    Appreciate your help!

    Thank you

    Ishti

    Hello

    I was able to get it working after some changes.

    Version compatible with Jython 2.5.1 FDMEE xlrd is xlrd 0.7.4

    Xlrd record is required to be placed inside the FDMEE server and the path is required to be updated in the script.

    Below the script just in case someone needs it:

    ===============================================================================================

    import sys

    custModlePath = fdmContext ["INBOXDIR"] + "\\Excel_Sample" # path in which is placed the folder xlrd

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Mapping.xls" # path to the Source file

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\" # path to the .csv file

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (pathout + "mapping.csv", "w" ")

    everything start_row_count<>

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =====================================================================================================

    Thank you

    Ishtique

  • Call the Essbase Calc of custom Script FDMEE script

    Hi Experts,

    In my reuirement, I must run Essbase calc script to export the perticular accounts data and then import these data into FDMEE to load in another planning application.

    I know we can run the Application Esbase calc script fromTarget page and after load. but in my case, executing the script should happen prior to importation.

    Aanybody may suggest an example if I can call the script to calc Essbase to a custom event BefImport script or FDMEE script? an example of the syntax would be useful

    Thank you!

    Hello

    are what version of FDMEE you?

    You have an example document to support FDMEE sample scripts (Doc ID 1613836.1)

    You can have a MAXL command in your batch file to perform the extract

    Example 5

    An example script to calc to perform an Essbase excerpt and then load the file extracted with FDMEE.

    1. Create a batch (.bat) file that performs extract Essbase.
    2. Call the scriptimport BefImport event operating system batch file
      import of subprocesses
      Import shutil
      OS.chdir ("D:\temp\\BatchFiles")
      command = ' D:\temp\BatchFiles\helloworld.bat > helloworld.out '
      p = subprocess. Popen (Command)
      RETCODE = p.wait)
    3. Load using FDMEE HelloWorld.out

    The Jython script can be created in the BefImport Script.

    Then you can have a rule of data loading with a file in it name (Ex: Essbase_Extract_XXXX) where XXXX is that five-year period.

    Your jython script should create this file, so in the case of import, the data is imported

    Keep in mind that it is an output of feature 11.1.2.4 box so if you are in 11.1.2.3.x I wouldn't put a lot of effort in a complex solution

    I hope that this puts you on the right track

  • Is it possible that we can add a custom column to the Inbox in the process BPM workspace

    Hello

    I want to know is possible that we can add a custom column in the Inbox view in the process (Oracle 11g SOA BPM) BPM workspace?

    Thank you

    Brijesh Kumar Singh

    Hello

    I have had, now it works fine

    Thank you

    Brijesh Kumar Singh

  • How to use the transformation script to add columns to the PK?

    I'm working on a script transformation that:
    -create a table
    -Adds the columns to the table
    -create a primary key for the table

    See the below script.
    Now, I want to add the primary key column.
    Documentation fix r: class IndexColumnUsage

    The Index of the class has a getter: getIndexColumnUsageList()
    and the list apply: applyIndexColumnUsageList

    Someone at - it an idea how to use these methods to add the column to the PK?

    I thank in advance.


    relational = model.getDesign () .getFirstOpenRelationalDesign ();
    table = relational.getTableSet () .createTable (null);
    table.setName ("TABLE");
    column = table.createColumn (null);
    column.setName ("COLUMN");
    index = table.createIndex (null);
    index.setName ("PK");
    index.setIndexState ("primary obligation");

    Hello

    If you have the column and index (both belonging to the same table) use:

    the index. Add (Column);

    to remove the column:

    the index. Remove (Column)

    Philippe

  • Need help with custom script to rename the layers

    Hello world.

    I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').

    I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.

    Any help is greatly appreciated.

    * Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).

    This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.

    #target illustrator

    function removeCopy() {}
    If (app.documents.length == 0) return;
    var app.activeDocument = docRef;
    recurseLayers (docRef.layers);
    }
    removeCopy();
    function recurseLayers (objArray) {}
    for (var i = 0; i < objArray.length; i ++) {}
    ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name');
    If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]);
    }
    }

    I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.

    var doc = app.activeDocument;
    var items = doc.pageItems;
    for (var g = 0; g)
        elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook ");
    };
    App.Redraw ();
  • ESXi 5.5 check if the custom script is running

    Hello

    I'm working on a solution, as remote custom for ESXi environments.  The only area that I have a problem, is that I need to check if my (running locally on the ESXi host) shutdown script runs in reality or (to avoid running processes in doubles).

    I know that in the ordinary Linux systems I can do things like (ps to the | grep "test.sh" | grep - v 'grep') or (c - stat %X /proc/ pgdump).  This doesn't seem to work on ESXi.

    Recommendations:

    • This must be run locally on the remote site
      • no access to the vCenter Orchestrator
    • No windows
      • The main system that will control the whole process is Debian
    • Do not install any 3rd party on ESXi hosts
    • Do not recommend N.U.T.S or APCUPSD
    • Must be able to check if the script works not the commands in the script
      • The real script runs several commands at different times

    Test configuration:

    1. Create a loop file in /tmp/test.sh

    #! / bin/sh

    I have = 1

    while [[ $i -le 1000000]]

    do

    echo 'Still running.  Step $i'

    ((i = i + 1))

    fact


    1. Make the file executable
      1. chmod + x /tmp/test.sh
    2. Run the test script
    3. Which can run to verify that the script still works?

    Any help is appreciated.

    Thank you

    B

    Ok.  Spend many hours looking for a way to see who "sh" process to run my script, I gave up and continued in the way of what has suggested Alistar.

    Solution: (linux - dirty way to ensure that only one instance of a shell script is running at a time - Stack Overflow)

    Basically, we create a file locking with the PID on the inside.  If the concurrent process give it a shot, they are arrested.  You can also look in the locking file to find the PID, if you want to force the exit, the newspaper, etc...

    For example

    #!/bin/sh
    LOCKFILE=/tmp/lock.txt
    
    if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
         echo "already running"
         exit
    fi
    
    # Remove the lockfile when process is exited
    trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
         echo $$ > ${LOCKFILE}
    
    #do stuff
    i=1
    while [[ $i -le 1000000 ]]
         do
              echo "Still running.  Step $i"
              let i=i+1
    done
    
    rm -f ${LOCKFILE}
    
  • To access the icons of InDesigns for custom scripts

    Hi all

    I think remember me a moment ago see a PDF file that had all the icons that uses InDesign and an access method and use them in my own custom scripts.

    I went through all my PDF resources which in have accumulated over the years and can't seem to find it. \

    Someone at - it a PDF file that contains this information, or resource online for this?

    Thank you very much


    Roy

    You can find a PDF catalog (Peter Kahrel site):

    Icon catalog

    Jarek

  • Remove empty columns

    I have the following columns:

    company

    address1

    address2

    City | ', ' || State | ' ' || zip

    Sometimes address 2 will be empty, because there is no data for this column. I want to be able to remove this empty space he leaves because of no data. I tried all anchor objects, then choosing their collapse, but that doesn't seem to work for me. I don't know if there is something more to him while cela or not. If Yes, could someone please tell me what I need to do? Is there another way to make the blank spaces to remove? Any help is appreciated, thanks!

    Hello

    If you want to make the address 2 hide column, make the vertical elasticity of the field address 2 variable value. For if the value exists in the database, it will show the address or if not the Address1 will be combined with city | State | Details of the country.

    On the other hand, you can opt for a conditional formatting to hide the column when the value of address 2 is zero.

  • Custom scripts does not work in Illustrator CC (2014)

    Some custom scripts that are part of my workflow do not work in the new CC; MultiExporter.jsx and Sprite CSS Generator.jsx.

    When I try to run is titled a modal window rises as if the script is running, but the actual window is only a few pixels maximum and cannot be resized.export-win.png

    sprite-gen-win.png

    They have both worked very well in CC. My scope of javascript is pretty basic, but is there code that needs to be changed to update these to work with the current version?

    Thank you!

    Bob

    It seems that this could be a system issue or a conflict; I uninstalled CC2013 AI and AI CC2014 so clearing out all the prefs, artifact files and folders. Then did a fresh install of CC2014 it has been able to use all my scripts inherited without problem.

Maybe you are looking for

  • record of the recommendations related to the material for music

    Can anyone recommend a minimum set of basic upward to record music with Garageband? I expect to play piano and singing, or playing guitar and singing. It is at the same time, then you can expect to need two microphones. I want to talk about a big bab

  • I want to reinstall FF 3.5.17, where can I find the archive for her?

    A 'friend' of mine to try to remove a virus where Firefox was showing that he was downloading .mp3 files, but nothing don't show up in the folder, decided to "help me" by installing FF3.6.15 who I was installing voluntarily NOT because most of the Ad

  • Beat mapping overview in 10.2.2?

    I've just updated tonight. Now the way beat tracks global mapping remains empty any channel (or the type of track) I select this option to use the analyze transients on. What was once filled with a waveform with transients has highlighted is now empt

  • Accident of service pack 1

    Windows update downloaded sp1 and now my machine is basically dead. It keeps just restarting at the helm of the Green window. safe mode does not work and my boot drive is not work.when I still use the drive I get a blue screen that says windows is un

  • How to recover the disc type and geometry of the disk on an optiplex gx260

    the disc type and the disc geometry has changed in the program of installation-F2 is NOT HOW they GOT CHANGED? OptiPlex gx260