Announcement

Collapse
No announcement yet.

Obligatory Fields

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Obligatory Fields

    Hello guys:

    Do you guys know of a way to make a field obligatory at runtime?. what I'm looking for is to read a few parameters from a table and then make the fields obligatory or not depending on the parameters listed.

    Regards.

  • #2
    You could simply hide the field based on parameters. That would be the easiest way. Then is the field is not hidden you can catch the OnValidate and complain that the field should be filled in with something that makes sense.

    Comment


    • #3
      Hey rr:

      It does make sense but it doesn't fill my needs.

      Thank you so much for your time anyways.

      Regards.

      Comment


      • #4
        It is also possible to make it writable or not writable. Fields with condition if it is writable or not, make "reload" when change - it is in Edit fields => {selected_field} => Lookup Settings => Reload form when value has changed

        Then in Events => onRefresh make:
        /**
        * Set a field as read-only
        */

        if ({field1} == 'some_value') // Set as read-only
        {
        sc_field_readonly({field2}, 'on');
        }
        else // Set as editable
        {
        sc_field_readonly({field2}, 'off');
        }

        Comment


        • #5
          well the thing is this:

          I have a form application for a contact request, the thing is depending if you knew about my customer from a magazine or an event i need the next field "Name of the event" to be obligatory tho i think my last option is to create a condition in the on validate event.

          Thank you guys anyways.

          regards

          Comment


          • #6
            Originally posted by kafecadm View Post
            well the thing is this:

            I have a form application for a contact request, the thing is depending if you knew about my customer from a magazine or an event i need the next field "Name of the event" to be obligatory tho i think my last option is to create a condition in the on validate event.

            Thank you guys anyways.

            regards
            So here is my take.
            I guess you have a select field or radio button to chose from: magazine, event ...

            In the onChange event of the select/radio you set the cursor in the field you want to be mandatory (could include hide/show).
            In the onBlur event of the input field you check if it is mandatory (see select/option) and if it has a value.
            If the test fails just set the cursor back (error message) or even reset the selection.

            jsb

            Comment


            • #7
              Thank you man.

              Regards

              Comment

              Working...
              X