Automate

 View Only
  • 1.  Changing Minimum for Attachment Control with Rule or JS

    Posted 04-11-2024 13:48

    By default, my minimum attachments required on an Attachment Control element is set to zero:

    Is there a way to set this minimum with a rule (or javascript snippet) to be "1" when a user clicks a button?



    ------------------------------
    Alexander Hutchinson
    RTX Corporation
    CHESAPEAKE VA
    ------------------------------


  • 2.  RE: Changing Minimum for Attachment Control with Rule or JS

    Employee
    Posted 04-12-2024 20:06

    Hi Alexander

    Not that I know of.  However, I have had two attachment controls - one was 0 and one was required 1.  I used a rule to show or hide the different attachment controls based on the value in the form. 

    Example - if customer type is sold to, you might need an attachment, but if it's a ship to, then you don't.  

    So for a sold to, I would show the attachment that required the 1 attachment, otherwise I showed the one that didn't.

    Hope that gives you an idea - and maybe others have a better one. :)

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Changing Minimum for Attachment Control with Rule or JS

    Employee
    Posted 04-13-2024 08:10

    Hi Alexendar,

    use below mentioned javascript code to update maximum or minimum number of attachments on your form :

    SVFormInternalAttachmentValidations['my:Attachment_1'].minimum 

    Notice the binding given to SVFormInternalAttachmentValidations is create as 'my:Name_Of_Attachment_Control_on_form'

    using this you can access all three properties of attachment control i.e : minimum, maximum and message.

    I have attached a test solution over the link : https://nowtransfer.de/21153bd289aa

    Hope this  helps.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 4.  RE: Changing Minimum for Attachment Control with Rule or JS

    Posted 04-15-2024 09:57

    Hammad,

    This worked excellently, thank you.



    ------------------------------
    Alexander Hutchinson
    Raytheon Co
    CHESAPEAKE VA
    ------------------------------