Forum Discussion

KarenKaren's avatar
KarenKaren
Qrew Trainee
12 years ago

Auto Numbering unique inventory items by department?

As we enter new items into our inventory database we would like it to automatically increase the inventory by 1.
We have several departments and each number should increment based on the department number
Expample

10-000111 would be one department
20-000234 would be a second department

The format has been used for many years and it would be difficult to change it. Also, we must start with the most current number for each department.

  • Debug your code:

    $.when(promise).then(function(xml) {
      console.dirxml(xml);
      console.log($("#_fid_191",xml).text());
      var next_item = $("#_fid_191",xml).text() + 1;
      $("#_fid_310").val("TMJPM-" + next_item);
    });
  • (Thank you for such a fast response!)

    If I'm debugging correctly this is the response I'm getting:

    'Attr.nodeValue' is deprecated. Please use 'value' instead.
  • There is no XML response showing up in your post. The string "'Attr.nodeValue' is deprecated. Please use 'value' instead." is a diagnostic message to the console dealing with some aspect of the code you wrote or is possible the request of QuickBase's code.
  • Agreed.
    After responding, I added some console.log("test"); lines before and after the

    console.log($("#_fid_191",xml).text());

    statement and it's showing empty row
  • Update: It does actually have the XML response in the console.

    This is the errtext I received:

    "This operation is only supported on individual tables and not on the application itself. Please check the URL."
  • You are probably specifying the application dbid instead of the table id on this line of code:

    var dbid = "your dbid here";

    I sometimes deviate from my own coding practices to save time. I would adopt the convention of writing the dbid's as follows:

    var dbid = "your application dbid";
    var dbidTable1 = "your Table1 dbid"
    var dbidTable2 = "your Table2 dbid"

    Also, it would help if you posted a new question when the thread is so old (a year in this case). It becomes diffiucult to read through the whole thread and parse out what the new issue is. Just concentrate on the unique aspects of your question.
  • Success!!

    I did pull the application dbid by mistake.

    Thank you very much for your help and feedback.

    I will be sure to post as new questions in the future.