locked
HTMLClient - Order Number RRS feed

  • Question

  • Hi All,

    I think I must be missing something obvious. I have a table called Jobs with a property called JobCode which has is not required, but included in the Unique index. I want to declare a base value and add the table Id to it to form the JobCode but for some reason it just places a string "NAN" in the field?!?!

    On the Add/Edit screen I have a function in the "BeforeApplyChanges" method because the ID doesn't exist on create. Perhaps it doesn't exist at this point either - if so I'm open to simple solutions to this ;-)

    I have the following code snippet:

     var NewCode = parseInt(screen.Job.Id);
     var BaseJobCode = 20000;
     
        // JobCode management
        if (screen.Job.JobCode == undefined) {
            screen.Job.JobCode = (BaseJobCode + NewCode).toString();
        }

    I've had no problems using various formula between the brackets in screen.Job.JobCode above but as soon as I try something with NewCode (even without the ParseInt) I get the NAN entry.

    Ideas?

    Cheers,

    Adam

    Saturday, February 28, 2015 9:41 PM

All replies