Any books on using javascript in design studio?

 3 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
KEVIN POINDEXTER
New Member
Posts: 3
New Member
    Anyone know of any resources on coding JavaScript in design studio? Found Lawson resources lacking, I am a cobol programmer needing to learn JavaScript, need to code some edits, we have created our own system code and have copied and modified Lawson programs with our own edits, easy to do but not a good idea, need to use JavaScript for edits like; use line item fields as the key for a DME call to check a value in a field in the retrieved record before a change or add, check the first two digits of the activity field against the first two digits of the accounting unit, etc., playing with
    function FORM_OnBeforeTransaction(val)
    if (val == "A" || val == "C") but I not sure how to loop through all the detail lines, would a beginner JavaScript book be helpful? have not had any luck getting user exits to work, again Lawson resources lacking on the subject, had an answerthink consultant tell us he has never got them to work, would like to revisit user exits some day if I can find more info on them, thanks for any info on some good resources
    John Henley
    Posts: 3353
      Kevin, I have taught a number of sessions and worked with several clients on both COBOL/user exit development as well Design Studio JavaScript.

      My first bit of advice would be to revisit the idea of using Design Studio to implement these edits, the reason is two-fold:

      1) the edits will only be applied when the user interacts with the form via Design Studio. If the form is accessed via ProcessFlow AGS, Excel addins, etc., the edit WILL NOT be done. If your intention is to enforce business rules, I would ALWAYS recommend coding them in COBOL user exits.

      2) the second reason is more a pet peeve of mine, so allow me to step on my soapbox. Each time Lawson has taken a new direction for the presentation layer of its products--and we've been thru several (OCS/Javascript, COM+, Design Studio), etc--they have provided NO MIGRATION PATH. Therefore, by coding these in Design Studio JavaScript, EXPECT THAT ANY INVESTMENT YOU MAKE MAY BE LOST. If you made them in COBOL/user exits, they would have survived each change in the presentation layer...

      Now, with that in mind, if you do decide to stick with Design Studio, you're going in the right direction...any edits should be made in OnBeforeTransaction. A lot of people (and Lawson's documentation) incorrectly point you to onBlur or onChange...which is a stupid way to do it.

      For a starting point, I would recommend the latest O'Reilly book on JavaScript. Most of the knowledge I have picked up has been via other examples relevant to Lawson from various CUE sessions and the Lawson KB.

      As for the number of detail lines, you did have to hard code the number of lines, but I think there is now a property (not sure which version it became available) that you can get that from....

      for (var nRow=0; nRow < 3; nRow++)
      {
      // clear the value on the form
      lawForm.setFormValue("text_reference","",nRow);
      }
      Thanks for using the LawsonGuru.com forums!
      John
      KEVIN POINDEXTER
      New Member
      Posts: 3
      New Member
        John,

        Thank you so much for the reply. I will definitely take another look at user exits. The problem is when one or our developers tried to create a user exit, he could not get it to work and the Lawson documentation was lacking in detail. Then a consultant told us he has never be able to get them to work, so we gave up on the idea. Based on your recommendation, I will take a crack at user exits. Any recommendations on user exit resources? Also, the company I work for would consider bringing in a consultant whose brain we could pick for a few days. Let me know if you have a referral for an expert in design studio, user exits and process flow. We are getting ready to start developing our first process flow. We are near Tampa and a local consultant would be a plus but not a requirement.

        Thanks,

        Kevin
        emorahan
        New Member
        Posts: 2
        New Member
          Kevin,

          Not sure if you got this issue resolved yet, but simple user exits are pretty easy to create, what exactly was the problem that your developer encountered when creating one. One thing would be to make sure you created the usrobj folder under $LAWDIR/productline/.