Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I am new to Javascript. I need to compare a previous value to current

    Code:
    //This Line of code gets me the current language of my database. How can I get the previous record?
    Code:
    var Lang = (record.fields.LANGUAGEPREFERENCEGRO);

  2. #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    4,556
    Thanks
    14
    Thanked 476 Times in 471 Posts
    there is no previous or next record in a database unless you apply some kind of ordering.

    but since you do not have a result collection there, a previous record does not exist anyways.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do have ordering. I use a program called Connect Designer, where a database gets attached to a PDF. It uses JavaScript obviously. Support suggested I search google. They believed it was possible to retrieve the previous record information, but not sure how.

  4. #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,473
    Thanks
    57
    Thanked 633 Times in 628 Posts
    Does Connect Designer have some sort of documentation?

  5. #5
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by xelawho View Post
    Does Connect Designer have some sort of documentation?
    It does, but only a search. Problem is they do not have documentation on JavaScript

  6. #6
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    During google search, I saw where I could use [-1] as shown below

    Code:
     var PreLang = (record.fields.FieldName[-1]);
    But I am assuming that is for arrays. but I am not sure how to load a field into an array. There are 6 variations.

  7. #7
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just for reference here is the documentation.
    PlanetPress® Connect 1.3 User Guide - Control Script API

  8. #8
    Regular Coder Synaptic's Avatar
    Join Date
    Apr 2015
    Location
    Las Vegas
    Posts
    127
    Thanks
    2
    Thanked 12 Times in 12 Posts
    What is your endgame? I just skimmed over Planet Press' Connect product. It seems like it does a ton of stuff that you can already do fairly easily with PHP. Aside from the networking monitoring it looks like that program just over complicates things. The documentation isn't very clear and it's pretty messy. Without going into what exactly you are trying to accomplish and what database you are using, it's hard for anyone here to give you good answers.

  9. #9
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to print a banner page before the first record, then when the language changes.

    For Instance
    Banner Page for English
    Prints all english records
    Banner Page for Next language
    Prints all records for that language
    repeat for all languages

    It is a new software. The old version used a language called presstalk and we were able to store the previous record language and compare the values of previous and current.


 

Tags for this Thread

Posting Permissions

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