Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 3 of 3

Thread: doRemove and doDelete don't seem to be recongnized as functions.

  1. #1
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default doRemove and doDelete don't seem to be recongnized as functions.

    Here is my script

    var Fi = new SCFile("ocmo");
    var Record = Fi.doSelect( "number=\""+ vars.$L_file.number + "\"" );
    if (Record == RC_SUCCESS)
    {
    print ("number :\n" + vars.$L_file.number);
    print ("number :\n" + Fi.number);
    var sc = Record.doRemove();
    return (Record);
    }

    And here is the error I get :

    Script <UNKNOWN> ligne 7 : ERROR TypeError: Record.doRemove is not a function au car 1

    same message for doDelete.
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

  2. #2
    Senior Member sigtb02's Avatar
    Join Date
    Feb 2002
    Location
    Québec city
    Posts
    104

    Default Found a new command that replaces the doDelete or doRemove

    rc = Fi.doAction("delete");

    This command deletes the record.
    Is what you're doing now creating the results you really want?

    Maybe it's time to do something different!
    .

  3. #3
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    Quote Originally Posted by sigtb02 View Post
    Here is my script

    var Fi = new SCFile("ocmo");
    var Record = Fi.doSelect( "number=\""+ vars.$L_file.number + "\"" );
    if (Record == RC_SUCCESS)
    {
    print ("number :\n" + vars.$L_file.number);
    print ("number :\n" + Fi.number);
    var sc = Record.doRemove();
    return (Record);
    }

    And here is the error I get :

    Script <UNKNOWN> ligne 7 : ERROR TypeError: Record.doRemove is not a function au car 1

    same message for doDelete.
    This is because the variable "Record" is the return code of the doSelect function.

    To delete the selected record you should use

    "var rc = Fi.doRemove();"

    And remember all javascript variables must be initialised before use.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

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