Manage Learn to apply best practices and optimize your operations.

Code IsNewDoc and IsDocBeingEdited in JavaScript

This tip shows you how to Code IsNewDoc and IsDocBeingEdited in JavaScript -- two JavaScript equivalents of common @Functions.

View member feedback to this tip.

This tip shows you how to Code IsNewDoc and IsDocBeingEdited in JavaScript -- two JavaScript equivalents of common @Functions.

function isNewDoc()
{
      url = window.location.toString();
      url = url.toLowerCase();
      if (url.indexOf("openform") == -1)
            return false;
      else
            return true;
}

function isDocBeingEdited()
{
      if (isNewDoc()) return true;

      url = window.location.toString();
      url = url.toLowerCase();
      if (url.indexOf("editdocument") == -1)
            return false;
      else
            return true;
}
      

MEMBER FEEDBACK TO THIS TIP

The code checks for ?editdocument but not for ?edit. There are other ways for a document to swap into edit mode as well.

—Doug J.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Curtis Stull. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on JavaScript for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close