Alpha Video Training
Results 1 to 2 of 2

Thread: Get Record Count / filter List Control / Change Price

  1. #1
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    403

    Default Get Record Count / filter List Control / Change Price

    Question on a list control with our POS. We want to run a Buy One Get One Free sale and want the POS to calculate the free item automatically.

    The free item should have the following conditions:
    1. Be equal or lesser value
    2. Belong to CATEGORY 1 through 12 (different clothing genders and sizes. Want to specify what's on sale)

    I have an Xbasic script that looks up the product and pull the values, and then passes it to Javascript to add the list row based on conditions - if it's on sale, percent off, set price, etc.

    What I want it to do:

    Calculate the record count.
    If it's an odd number, ignore the odd one with the highest PRICE.
    Compare the remaining even number of records, take the lowest PRICE half and set the discount to '100'.

    That should in my mind do the job to give the customer the free items which is of equal or lesser value.

    Ideally, this runs each time a product is scanned. OR, there could be a button on the UX control that calculates this all once the scanning of products is done. I assume the latter would be easier?

    List control = 'ORDERITEMS'
    Price field = 'PRICE'
    discount field = 'DISCOUNT'

    Any help in the right direction would be appreciated. Stared at this for 8 hours now and I just can't get it started.

    Thanks in advance!!!

    The attached image shows the example. One of the 3.99 items should be ignored, and one of the 2.99 and 1.99 should be set to zero.

    GRAPHICS-0018.png

  2. #2
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    403

    Default Re: Get Record Count / filter List Control / Change Price

    Let's start with filtering the row count or data.length. I want to filter the _data.length by the category. I want to filter by category number 1. The value would be just an integer '1'.


    Code:
    var listObj = {Dialog.object}.getControl('orderitems');
    var cat = listObj.getData().CATEGORY;
    
    
    alert( {dialog.object}.getControl('orderitems')._data.length)

Similar Threads

  1. get a record count in to a list
    By richard2007 in forum Mobile & Browser Applications
    Replies: 4
    Last Post: 09-09-2015, 08:30 PM
  2. List Control VISIBLE count? Used when a list has some rows hidden.
    By CarlMPearson in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 10-21-2014, 08:56 PM
  3. Row count on UX list control - help please? What's wrong with this code / design.
    By RobGordon in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 10-14-2014, 10:06 AM
  4. Re-create Item Price List for Price Level
    By iNetElle in forum QReportBuilder
    Replies: 11
    Last Post: 08-22-2011, 10:24 AM
  5. How can I display basic price list on every record
    By brianp in forum Alpha Five Version 6
    Replies: 4
    Last Post: 03-17-2007, 06:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •