Questions on making some basic DS mods

 9 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
TBonney
Veteran Member
Posts: 281
Veteran Member
    I apologize for my ignorance. However, I am new to Design Studio and have found the User Guide to be not much help, so I thought I'd ask the forum for some guidance on some what I thought would be "easy") changes I am attempting.

    I am trying to modify PA90 and am unable to figure out how to do the following tasks:

    1. 'Hide' a field. (I still want it to be present, but not visible to end users, so I am trying to avoid deleting it outright.)
    2. Make a field be required.
    3. Change a drill field to a drop down list only.

    Any guidance is appreciated. Thank you.

     
    Eddie Smith
    Advanced Member
    Posts: 39
    Advanced Member
      To hide a text field, simply check 'Output only' on the (Custom) section of the field properties. For items 2 and 3 will require the use of JAVA scripts.
      John Henley
      Posts: 3353
        The Design Studio form is just XML that replaces the "standard" XML representation of the form; you are merely changing the presentation of the form, but not the back-end business logic (COBOL/4GL). One thing to keep in mind is that Design Studio customizations ARE NOT applied from either Smart Office or Excel Addins.
        1. Just delete it in Design Studio; it still remains on the form (in the "business logic").
        2. That's actually easier in COBOL/4GL, but then becomes a modification to the XXyy.scr form definition. You can also do it via a COBOL user exit, which technically isn't a customization. To require a field in Design Studio, you have to write some javascript in the FORM_OnBeforeTransaction event.
        3. You can do this by selecting the properties of the text field; and deselecting the 'Allow Drill' option.
        Thanks for using the LawsonGuru.com forums!
        John
        John Henley
        Posts: 3353
          Posted By Eddie Smith on 05/31/2013 01:39 PM
          To hide a text field, simply check 'Output only' on the (Custom) section of the field properties. For items 2 and 3 will require the use of JAVA scripts.

          This actually just hides the field, but still leaves it visible, i.e. but 'read only'. The question was how to remove the field from the form, but still leave it on the form (for logic purposes). "Deleting" it from the Design Studio form changes the field type in the underlying XML to "hidden" ( tp="Hidden" ), but the field still exists.
          Thanks for using the LawsonGuru.com forums!
          John
          TBonney
          Veteran Member
          Posts: 281
          Veteran Member
            Thank you for the guidance Eddie and John!

            Based on your feedback, I have been able to master almost all of the PA90.1 changes I needed to, for both #1 and #3.

            In order to accomplish the required/not required changes that are desired (in #2), I'd rather accomplish them in a manner that is not recognized as a customization if possible. Would you be able to identify which .js file I would need to update in order to accomplish these changes using javascript as you suggested John (or anyone else for that matter)?

            Thanks, in advance!
            Eddie Smith
            Advanced Member
            Posts: 39
            Advanced Member
              Below is a JAVAscript to make currency field on AC10.1 a required field.

              ==== make currency code field a required field on AC10.1 ====

              function FORM_OnBeforeTransaction(fc)
              {
              var continue_add=true
              if(fc=="A"||fc=="C")
              continue_add=addCode()
              if(continue_add)
              return true;
              else
              return false;
              }
              function addCode()
              {
              var code=lawForm.getFormValue ("text4")
              var message="You must enter Currency Code"
              if(code!="")
              return true
              else
              {
              lawForm.setMessage(message);
              alert(message)
              lawForm.positionInField("_f21");
              return false
              }
              return true
              }
              Terry P
              Veteran Member
              Posts: 234
              Veteran Member
                Eddie - good job on the example. I might add on it to make it even more functional when you have multiple fields you want to check. Pass a variable to the function something like this so you can reuse the function for different fields. You could also have the field ID and Message as variables and pass them to one generic function.

                var vFieldName = "text4"

                continue_add=addCode(vFieldName)

                ...

                function addCode(vFieldName)
                {
                var code=lawForm.getFormValue (vFieldName)
                ...
                }




                TBonney
                Veteran Member
                Posts: 281
                Veteran Member
                  When I select the 'Script' button in Design Studio (on the form in question - PA90.1), it is blank.

                  Then when I try to save the form after adding the javascript specific to making one field required (the 'Establishment' field, in the header), it errors on me upon de-selecting the Script tab...stating: "Script is saved without syntax error checking. A script control component is not found. Please refer to the documentation for download instructions."

                  Does anyone know what this error means, or have ideas on how to fix it?

                  Thank you!
                  Terry P
                  Veteran Member
                  Posts: 234
                  Veteran Member
                    That is usually just a warning. Try changing your Internet Option settings to allow Active X - can't remember exactly which one it is though. That should fix it, and then it will give you basic error checking.
                    TBonney
                    Veteran Member
                    Posts: 281
                    Veteran Member
                      Thanks Terry. I'll check this out later this afternoon.