Help finishing, new Date .valueOf () ();

I searched a lot on the internet yesterday to nothing does not. I created a form and have a field of text called "InvoiceNumber". I wanted a script that would create an invoice number and was found - new Date () .valueOf ();. That's exactly what I was looking for because I used something similar in Livecycle but I don't know how to put this script in the form, so it generates the number in my text field when the form is opened.

I found where you click on "pages" in the sidebar, right click on the form page, click page properties, take action and then set up a script of the opened page. I guess that is where I would put the script above, but if this is the case how can I tell the script to have the number generated in the field "InvoiceNumber"? Any help would be greatly appreciated.

this.getField("InvoiceNumber").value = new Date .valueOf () ();

However, I do not recommend using the action of the page, because who would have executed every time the page is opened (for example, if you navigate to another page and then come back). A better option is to place the code as a script at the level of the doc, by going to tools - JavaScript - Document JavaScripts and place it (NOT inside a function).

Tags: Acrobat

Similar Questions

  • Clipboard (Win 7) is "full" and will not copy new data

    My Clipboard (Win 7) seems to have "full" and will accept no new data. He sticks the previous element rather than a new one. Restart it cleared, but it's a pain. Regardless of what I copy to-laptop, Notepad, Word, etc. I read in a manual way to clear the Clipboard, but it should not be necessary. Also read a MS patch 'emptyclipboardtoset', but do not know how to find and download it. Thank you for your help.

    Hello

    The question you posted would be better suited in the MSDN forums. Send the query in the link for assistance.

    http://social.msdn.Microsoft.com/forums/en-us/perfmon/threads

    Hope that helps.

  • adding new data in the table property variant

    Hello guy,

    I have a Qml property

    property variant placeName:[]
    

    I would now like to add data in this property at run time.

    I checked this link:

    http://Qt-project.org/doc/Qt-4.8/QML-Variant.html

    but there, I found that we can "Update" the property data.

    What to add new data?

    Please help me as soon as possible...

    property real estate to qml aren't real javascript arrays, so to mutate them you need a reallocation.
    as
    var tmp = placeName;
    tmp.push (a);
    placeName = tmp;

  • [Explanation necessary] Clears the listview data and fill it again with new data

    Hello

    I correctly filled a listview in c ++, data analysed and does interesting things with it. However, I am drunk stumbling, unable to find a way delete and repopulate my display of the list...

    Question 1:

     

    1. How can after I insert data in the list view, I clear the list data and run again the same method (init) who populated the list view with the data in the first place?

    Here are the docs that I referenced and I don't understand how to implement the methods in my code.

    QList - clear() method

    https://developer.BlackBerry.com/Cascades/reference/QList.html#clear

    Using the data access Code, example
                              
    data_access/using_data_source

    GroupDataModel - Clear()

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__groupdatamodel.html#clear

    CODE

    Here is my code - filling of the display of the list of C++ and display of data in a ListView.

    MyApp.cpp

    MyApp::MyApp(bb::cascades::Application *app)
    : QObject(app){
        // create scene document from main.qml asset
            // set parent to created document to ensure it exists for the whole application lifetime
            QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
                AbstractPane *root = qml->createRootObject();
                qml->setContextProperty("yoyo",this);
                //grab references
                list_view = root->findChild("listView");
    
                // set created root object as a scene
                app->setScene(root);
    
                mNetworkAccessManager = new QNetworkAccessManager(this);
                bool result = connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
    
                 Q_ASSERT(result);
                 Q_UNUSED(result);                 json = new QFile("data/file.json");
    }
    
    void MyApp::init(){
        QNetworkRequest request = QNetworkRequest();
         // i call some service here
         mNetworkAccessManager->get(request);
    }
    
    void MyApp::requestFinished(QNetworkReply *reply){
        qDebug() << reply->error();
        qDebug() << reply->errorString();
        if (reply->error() == QNetworkReply::NoError) {
            qDebug() << "No error";
    
                    QByteArray data = reply->readAll();
    
                    if (!json->open(QIODevice::ReadWrite)) {
                        qDebug() << "Failed to open file";
                        return;
                    }
                    json->write(data);
    
            bb::data::JsonDataAccess jda;
            QVariantMap results = jda.loadFromBuffer(data).toMap();
                    QVariantList lst = jda.loadFromBuffer(data).toList();
                GroupDataModel *m = new GroupDataModel();
                       m->insertList(lst);
                       m->setGrouping(ItemGrouping::None);
                       if(list_view) list_view->setDataModel(m);
    
        }else{
            showDialog("Boo",reply->errorString());
        }
    }
    

    MyApp.hpp

    // Tabbed pane project template
    #ifndef MyApp_HPP_
    #define MyApp_HPP_
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    namespace bb {
    namespace cascades {
    class Application;
    }
    }
    namespace bb {
    namespace data {
    class Application;
    }
    }
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class MyApp: public QObject {
    Q_OBJECT
    public:
        MyApp(bb::cascades::Application *app);
        virtual ~MyApp() {
        }
        Q_INVOKABLE
        void init();
    private slots:
        void requestFinished(QNetworkReply *reply);
    private:
        QNetworkAccessManager *mNetworkAccessManager;
        QNetworkRequest *request;
        QFile *json;
        bb::cascades::ListView *list_view;
    };
    
    #endif /* MyApp_HPP_ */
    

    hand. QML

    import bb.cascades 1.0
    
    Page{
    Container {
                            background: Color.White
                            ListView {
                                id: listView
                                preferredHeight: maxHeight
                                objectName: "listView"
                                listItemComponents: [
                                    ListItemComponent {
                                        type: "item"
                                        Container {
                                            Container {
                                                Label {
                                                    text: ListItemData.id
                                                }
                                            }
    
                                        }
                                    }
                                ]
                                onTriggered: {
                                    console.log("selected_index: " + indexPath)
                                }
                                horizontalAlignment: HorizontalAlignment.Center
                                verticalAlignment: VerticalAlignment.Center
                            }
    
    }
    }
    

    Question 2:

    How reference to the ListView object with the name "listView" in different parts of the MyApp.cpp file? Is there anything else I should add to the header file to make the accessible listView?

    Question 3:

    What happens when you call the clear() method? How the data model is affected? How the user interface is affected? What happens in memory?

    Question 4:

    How do you verify that the data in the list has been deleted so that you can go ahead and fills again with new data? What is the cheque that I perform?

    I would also like to know how you manage multiple views of lists and data sources in your applications. Best practices or ideas?

    Thank you

    I was able to clear the listview with the following code, if anyone is interested.

    listView.dataModel = null
    

    The dataModel must be set to "null".

  • Date.valueOf () does not not as expected

    Hello

    According to http://www.w3schools.com/jsref/jsref_valueof_date.asp, the. valueOf() method must return a whole number of milliseconds for the given date. However, when running my application, I get a UTC string (e.g. 'Thursday 19 January 2012 21:50:23 GMT + 0000 (eastern standard time)') when I use this method.

    If anyone knows how to do the conversion equivalent milliseconds for a given date?

    I am currently using OS 7.0 on a 9810.

    Thank you

    Have you tried:

    var d = new Date();
    document. Write (d.getTime ());

    I have not tried it myself, but it should work.

  • How to migrate Office persistent link clones of workstations for the new data store

    Hello. We have clones of persistent link to view running in the environment from our view. We need to migrate these desktops to new storage. Rebalancing is out as this will include a refresh operation - destroy anything and everything installed in c:\ of the user. Is there a method to migrate Desktop clone link persistent to a new data store, while keeping the office in the same exact state (i.e. c:\ is not updated).

    Thank you

    Never say impossible. I came across the solution when I read the article by Duncan Epping:

    http://www.yellow-bricks.com/2012/03/15/Dr-of-view-persistent-linked-clone-desktops/

    I have that for my situation. Basically, replicate data from view in the new storage warehouses. Set up data warehouses replicated without re-signing with the cluster of ESXi. Turn the power off and unsubscribe the vCenter view workstations. Save the workstations from the data store replicated/mounted to vCenter and power over desktop computers.

    VCenter, nothing dramatic has happened if she sees just as vm being unregistered and re-recorded activity from the same exact data store (the same UUID). View Admin is happy because he sees just the events as desktop computers that have been turned off and then subsequently in reverse. Nothing has changed regarding the database to view ADAM, we still use the same data warehouses.

    I have already tested before for a scenario of View DR, and he succeeded. Between remembering who and Duncan's article helped me to adapt the same process for this. Nothing is impossible

  • Help with the data store migration script

    Hey everybody,

    I am currently responsible for the migration of disks in new storage. Each virtual computer might have multiple disks on different data warehouses. The script I'm working on that will check the VM for the disks located on a certain store of data, then if necessary to migrate the disk to the new data store. However, I'm lost. I hope I'm at least on the right track. Any help is very appreciated.

    Thank you!

    $csv = import-Csv-Path "e:\scripts\hunter\vantage_qadev.csv".

    foreach ($ent in ($csv))

    {

    $ds = get-Datastore ' QADEV_OS_HUS127 * ' | Sort descending FreeSpaceGB | Select-Object - 1 first

    $vmname = get-VM-name $ent.vmnames

    $vmds = $vmname | Get-hard drive | Select file name

    If ($vmds - eq "* QADEVOS_VSP986 *") {Get - VM $ent.vmnames |} Get-hard drive | Moving-hard drive - Datastore $ds}

    Else {Write-Host "Migration without any preconditions"}

    }

    That's what I did to make it work. The fact it's supposed to I would say...

    $csv = Import-Csv -way "e:\scripts\hunter\vantage_prod.csv".

    foreach ($ent in ($csv))

    {

    $ds = Get-Datastore ' DST_PROD_OS_HUS127 * ' | Sorting FreeSpaceGB -down | Select-Object -First 1

    Foreach ($HardDisk in (Get-VM -name $ent.vmnames |)) (( Get - hard drive))

    {

    $vm = Get-VM -name $ent.vmnames

    $hds = Get - hard drive -VM $vm

    $lunname = Get-VM -name $ent.vmnames | Get - hard drive | Select-Object -Property @{N = "Datastore"; E = {$harddisk. FileName.Split("]") [0]. TrimStart("[")}}

    If ($lunname - like "* DM_PROD_OS_VSP986 *") {Get-VM -name $ent.vmnames |} Get - hard drive | Moving - hard drive { -Data store $ds -confirm: $false}

    else {Write-Host $ent.vmnames ' not migrated '}

    }

    }

    What is a better way to do it?

  • PowerCLI, vm of moving to the new data store

    Hello

    I have to move vm to a new data store

    What are the good commands powercli

    my version of my CV is 5.0xxxx

    Thanks for your help


    You can use the Move-VM cmdlet to move a virtual machine to another data store: for example:

    Move-VM - VM "MyVM1" - data store "MyDatastore1".

  • Help with a date field script

    Sorry if this is a repeat. I was interrupted and found that my browser crashed when I'm new so I don't know if the question arises.

    I need a script for a date (mm/dd/yyyy) field where the user can fill only a date that is between 12/31/1899 and the current date (no matter what the date when the form is open). I'm getting to write this but I could not with this one. Any help would be greatly appreciated.

    Thank you!

    I have a feeling that I already answered this question some time ago... Anyway, you can use this code as a script custom validation of the field:

    var minDate = util.scand("mm/dd/yyyy", "12/31/1899");
    var maxDate = new Date();
    event.rc = true;
    if (event.value) {
        var d = util.scand("mm/dd/yyyy", event.value);
        if (dmaxDate) {
            app.alert("Error! The entered date must be between " + util.printd("mm/dd/yyyy", minDate) + " and " + util.printd("mm/dd/yyyy", maxDate));
            event.rc = false;
        }
    }
    
  • ESX 3.5 move VM OS to a new data store

    Update of ESX 3.5.0 Build 4 153875

    I have a front-end server, Exchange 2007 (2008 x 64 OS), which has only a single drive (OS) configured on a data store presented by Clarion AX4.5 SAN. I wanted to move this disk in another data store that has more free space and the highest performance, but I'm not sure of the exact procedure.

    1 so I wanted instead of the disc on the data store runnign run it on the data store 2.

    Can I clone it to the same ESX host and simply select the new data store? Or would it be preferable to P2V to the new data store. This seems like it should be simple, but I'm stuck on what is recommended for this. Of course, since it is the front-end exchange I want nothing to screw.

    Thank you in advance for your help!

    If you have virtual center the easiest might be to cold migrate stop the virtual machine and migrates - you can leave it on the same ESX host, but will give you the ability to move the virtual disk.

  • Cannot add a new data store

    Let me preface this post by saying that I am an extreme noob to VMWare... Have only used MS HyperV in the past but looking to oust most of my hardware with VMWare on the recommendation of a colleague.

    On the problem.

    I have a server Dell PowerEdge 2900 with 32 GB of RAM and 8 TB of disk space.

    I installed ESXi yesterday and you can see my original data store, called "datastore1", which is only 325 GB.

    I try to add a new data store, but when I go to 'Add storage' in vSphere, select ' disk/LUN", the list is empty.

    I know I'm missing something, but don't know where to look.  What should I do to add a new datasore and subsequently more storage to my VMWare environment?

    DRM for all help!

    To add a data store storage must be allocated to the vSphere server.  There is also a size limit of 2 TB less 512 bytes per LUN for a vSphere.   Try a few small LUN and see if they appear as available when you add a data store.   I have included a link pdf maximum configuration for vSphere 4.1

    http://www.VMware.com/PDF/vSphere4/R41/vsp_41_config_max.PDF

    If you have found this device or any other useful post please consider the use of buttons useful/correct to award points

    Twitter: http://twitter.com/mittim12

  • Need help with the data storage store, local array and network connections

    Need help with my ESXi 4.1 installation

    My hardware:

    I built a server with an Asus P6T whitebox, i7 920, 12 Gig RAM, NIC, Intel Pro1000 PT Quad, 3ware 9650SE-12ML with 8 1.5 TB SATA green in a raid 6 array gives me about 8 + TB with a spare drive all housed within a NORCO RPC-4220 4U Rackmount Server chassis.  I also have a 500 GB SATA drive which will hold the ESXi and virtual machines.

    The network includes a firewall, Netgear Prosafe FVS336G, GS724Tv of Netgear ProSafe 24 port Gigabit Managed Switch on a dhcp cable modem internet service provider.

    I also have 2 old NetGear SC101T NAS disks (4to) I want to connect to the system how some - at a later date have... data on them and want to transfer to the new storage array. I always looking into the question of whether they will work with ESXi 4.1, or I might have to only access it through Windows XP.

    My Situation:

    I have already installed ESXi 4.1 and vsphere client with no problems and it is connected to a dhcp cable internet service.  I've set up host via a dynamic DNS service name give me a static hostname on the internet.  I installed three machines to virtual OS successfully at the moment and now want to first start by creating a multimedia storage server which will use some of this new 8 TB array, then separate data storage for use with a web server small overhead storage and a backup.  It is a domestic installation.

    Help with the data store and network:

    I was doing some reading, because I'm new to this, and it looks like I'll probably want to set up my table via ESXi as a nfs disk format.  Now, the data store is usually in another physical box from what I understand, but I put my readers and ESXi all in the same box.  I'm not sure that the best way to put in place with grouped network cards, but I want to make this work.

    I understand that in ESXi 4.1 using iSCSi LUN must be less than 2 TB, but nfs - I should be able to add a bigger partition then 2 TB (for my multimedia) in nfs, right? or should I still add it separately as a separate 2 TB drives and then extend them to get the biggest space.

    Any suggestions or direct resources showing examples on how to actually add some parts of the table as data warehouses separate nfs.  I know that to go to the configuration tab, and then select Add to storage, and then select nfs. I have not my picture, but it's here that I don't know what to do because ESXi 4.1 system already has an address, should I put the same thing to the new data store array also (will it work?), and what should I use for the name of the folder and the store of data... just do something to the top.  I thought to later install Openfiler (for a multimedia storage using this table server) as a virtual machine, use the table with esxi so that I can access the same storage space with widows and linux-based systems.

    I also know I have to find a way to better use my quad nic card... put in place of virtual switches, grouping, etc HELP?

    Any direction, assistance, similar facilities to sample, suggestions or resources that would help would be great. I did a lot of hunting, but still a little confused on how to best to put in place.

    You must think of VMDK files of large databases with records of random size guest go read some data (a DLL or an INI file), maybe write some data back, then go read other data. Some files are tiny, but certain DLLs are several megabytes. It's random i/o all and heavy on the search time. IO Opsys is small random operations that are often sequential (go read data, write data, go read other data,...) so that deadlines are critical to the overall performance. That's why people say OPS are / s of reference and forget the MBs flow. The only time where you bulk transfers are when you read media (ISO files).

    Well, now forget all this. Actually the disk activity will depend on the specific applications (database? mail server? machines compiler?), but the above is true for boots, and whenever applications are idle. You should see the profile to know.

    RAID 10 is faster (and often more reliable) than RAID 5 or RAID-6 except in certain specific cases. In General RAID 10 is ideal for many random writes, since the calculation of parity for RAID-5 and - 6 adds to the overall latency between command and response - latency is cumulative if a little slow here and a little slow it adds up to a lot of overall slow synchronous especially with e/s on a network. OTOH RAID-5 and -6 can produce faster readings due to the number of heads, so you can use it for virtual machines that transfer bulk. Test. You may find that you need several different types subdashboards for best results.

    You said 3ware, they have some good grades on their site, but don't believe it. With my 9650 that I found myself with only a couple of their recommendations-, I put the (simple) table for allocation size 256 k, nr_requests at 2 x the queue_depth and use the planner date limit. I had the habit for the Ext4 file system formatted with stride and stripe-width synced to the table and used the options large_files with fewer inodes (do not use the huge_files option unless you plan to have single VMDK files in the terabyte range). Use a cache of great reading in advance.

    Virtual machines use VMDK files in all cases except raw iSCSI LUN that they treat native disks. VMDK is easier to manage - you can make a backup by copying the file, you can move it to a PC and load it into another flavour of VMware, etc. There could be some features iSCSI to your San as a transparent migration but nothing for me. NFS has less chatter of Protocol if latency lower times to complete an operation. NFS is good to read and write a block of data, that's all it boils down to.

    UPS is good, but it won't help if something inside the machine explodes (UPS does nothing if the PC power supply goes down). If the RAID card has an option for a battery backup module, so it can contain some writings in memory and may end up the disk i/o after replacing the power supply. 3ware also limits the types of caching available if help is not installed, and you get just the right numbers with the module.

  • Add new data to the table in a log file

    Hi all. I am new to Oracle and I need to also write new data table in a logfile on Linux in order to live in the display screen. My first thought was to write a trigger, and after some research on googled around, I finally came to this:

    create or replace trigger foo_insert
    After Insert on foo
    for each line
    declare
    f utl_file.file_type;
    s VARCHAR2 (255);
    Start
    s: =: new.udate | '-' || : new.time | ' ' || : new.foo | ' ' || : new.bar | ' ' || : new.xyzzy | ' ' || : new.frobozz | ' ' || : new.quux | ' ' || : new.wombat;
    f: = utl_file.fopen ('BLAH_BLAH', 'current.log', ' a');
    UTL_FILE.put_line (f, s);
    UTL_FILE.fclose (f);
    end foo_insert;

    It seems properly to add new data in the log file as new inserts occur, but open and close the file each time are of course not optimal.
    In the app real new lines could have inserted every second or two. How can I optimize it? In addition, the log file will be archived and turned every day, so there must be a way to effectively report the relaxation of the oracle to reopen the case.


    Thank you!

    >
    I would like to pursue the optimization of the trigger
    >
    As Ed suggested you need to think this through a few others and refine the requirements.

    You said "I am new to Oracle. So you may not realize that anything a trigger didn't REALLY EVEN HAPPEN! The transaction can still be restored by Oracle or by the appellant. Want that all the 'hiccups' look too? If this isn't the case, then you can not use a trigger to do this. You need the process that translates the trigger being called to do logging after the data is stored.

    It should be noted that this requirement is before we can offer solutions to a problem.

    Assuming you want the trigger record all attempts change the data, then the best way I know to do that is to minimize the work does the trigger.
    Another fundamental principle is to follow the advice of the Ed and have a clear separation and distinction between "what" should be done and 'how' to do it.

    To minimize the trigger work change proposed Nicosa approach. Create an AUTONOMOUS_TRANSACTION stored procedure that handles the 'how' and just have the trigger to transfer data to the stored procedure values. The trigger provides data; He doesn't know, or care, what is done with the data.

    The stored procedure is then free to use the files, a table, write to a file or any other method is proving to be the best. You can change the methods without affecting the trigger.

    A queue or table may contain data, but again once you need to think about the obligation. Do you need fair access to data only once? Now, you want a "tail". But what happens if this requirement change tomorrow? You won't have to redesign the architecture.

    With a queue once you delete the queue data it won't here later if you want to get it again. With a table you can take as long as you want.

    I would like to start by using a table to store the data. If you use a sequence number or "insert_date" value, you can always query the data of interest. The table just collects data. He does not care how to use data.

    So, by using proven design principles and knowing that the requirements are for the most part unknown and may change unexpectedly, I would be:

    1. create an AUTONOMOUS_TRANSACTION stored procedure that accepts the parameter data and the thicket in a simple logging table.
    2. change your trigger to call the procedure to step #1
    3. create another procedure that performs a query of 'tail' for you will depend on 'insert_date' number or sequence. This query can write data to a file or return a cursor ref that your script can use to provide data for display.

    The approach described above takes each step in the process relatively independent of the other stages.

    Until put you the finishing touches to the requirements that you do not want to lock up your initial design.

  • need help for calculation date

    I need help with this:

    I added successfully a document level script to add the date printed in my document

    this.getField("DatePrinted").value = util.printd ("mm/dd/yy", new Date());

    I now need to fill in a field named "Date" with a date that is 14 days after the date of DatePrinted.

    and I'm lost.

    Can anyone help?

    Get the current date/time

    var d = new Date();

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set a field value

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

    That last part may need to be changed depending on where you place the script. If it's the same script at the document level, the whole thing can be:

    Get the current date/time

    var d = new Date();

    Set a field value

    getField("DatePrinted").value = util.printd ("mm/dd/yy", d);

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set another value of field

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

  • Help finishing a function which checks a table

    Hi guys,.

    I need help finishing a function that checks the 6 items (indiciesOfInterestShape) in a table dynamically updated (productCode) for two types of values. the number 0 or any number between 1 and 8.

    I need the result of this function to update the variable finalNumber to a number between 0 and 6.

    If a 0 is found in all 6 clues that it will result in the final number type argument no increase.

    If a number between 1-8 is located in one of the 6 index then the final number increases by 1. And because there are only 6 clues to check the maximum number only will never be 6.

    That's what I have so far

    // indicies that are dynamically updated           4        7      10     13     16     19
    public static var productCode:Array = [C,A,1,A,1,A,A,1,A,A,0,0,A,0,0,A,0,0,A,0,0,A]
    
    public static var indiciesOfInterestShape:Array = [4, 7, 10, 13, 16, 19];
    public static var finalNumber:int = new int;
    
    public static function countShapes(productCode:Array, indiciesOfInterestShape:Array){
        for (var i:int = 0; i < indiciesOfInterestShape.length; i++){
            var indexTolookAt:int = indiciesOfInterestShape[i];
            var item:String = productCode[indexTolookAt];
            if (item == 0){
                "add zero to finalNumber"     //help needed here changing the finalNumber
                }
            else{
                "add 1 to final number"        //help needed here changing the finalNumber
                }
            }
    }
    

    Something to keep in mind, if a certain product code adds 1 to the final number index (as 1-8), but is then changed dynamically to 0, I need the number back down by 1.

    Hope this has meaning and that someone could point me in the right direction at best.

    Thanks in advance!

    // indicies that are dynamically updated           4        7      10     13     16     19
    public static var productCode:Array = [C,A,1,A,1,A,A,1,A,A,0,0,A,0,0,A,0,0,A,0,0,A]
    public static var indiciesOfInterestShape:Array = [4, 7, 10, 13, 16, 19];

    public static var finalNumber:int = 0;

    finalNumber =countShapes(productCode, indiciesOfInterestShape);

    public static function countShapes(productCode:Array, indiciesOfInterestShape:Array):int {

        var finalNumber:int = 0;
        for (var i:int = 0; i < indiciesOfInterestShape.length; i++){
            var indexTolookAt:int = indiciesOfInterestShape[i];
            var item:int= productCode[indexTolookAt];

            if (item != 0){
                finalNumber++;
            }
        }

         return finalNumber;
    }


Maybe you are looking for