Automate

 View Only
  • 1.  Evolve Attachment Element properties

    Posted 02-02-2026 22:01
    Edited by Renette Nienaber 02-03-2026 03:48

    How do I set a rule to influence the minimum value of an Evolve attachment element based on the value of another field.

    I would like to set the minimum to 1 to make an attachment mandatory when another field value = 'X".



    ------------------------------
    Renette Nienaber
    Mrd
    VIVO ENERGY SOUTH AFRICA (PTY) LTD
    ------------------------------

    found the following but link no longer active. kindly post active link to the solution.

    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.
    ------------------------------



  • 2.  RE: Evolve Attachment Element properties

    Employee
    Posted 02-03-2026 04:58

    Hi Renette,

    Solution is available on below link, when you  enter X in Field_4 it will set Attachment control mandatory and require atleast one attachment, else it will set it to 0, refer rule applied on Field_4.

    https://nowtransfer.de/21826f8fa5ff

    hope this helps.

    Regards



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



  • 3.  RE: Evolve Attachment Element properties

    Posted 02-03-2026 05:11
    Edited by Renette Nienaber 02-03-2026 05:12

    Magic ! Thank you so much for the prompt support.



    ------------------------------
    Renette Nienaber
    Mrd
    VIVO ENERGY SOUTH AFRICA (PTY) LTD
    ------------------------------



  • 4.  RE: Evolve Attachment Element properties

    Posted 16 days ago

    Hammad,

    Is there a method to removed the red "Required" error message under the Attachment Control when you remove the X in Field_4?

    Example - When I place an X in Field_4 I can set minimum=1, maximum=1 and message="" in the Attachment

    If I try to submit I get the "Required"... which I should.

    However, if I remove the X in Field_4 and set set minimum=0, maximum=1 and message="" which works but the "Required" message still appears, but allows me to submit the form.



    ------------------------------
    Kurt Marshman
    Self-Registration Shared Account
    ------------------------------



  • 5.  RE: Evolve Attachment Element properties

    Employee
    Posted 16 days ago

    Hi Kurt,

    you can modify the javascript code as below:

    -----------------------------------------

    if ($form.getValue('/my:myFields/my:field_4') == 'X') { 
        SVFormInternalAttachmentValidations['my:Attachment_1'].minimum = 1
    }
    else
    {
        var theBinding = 'my:Attachment_1';
        SVFormInternalAttachmentValidations['my:Attachment_1'].minimum = 0;
        var attachments=  $j('span[binding="' + theBinding + '"]');
        var attSpan = $j(attachments[0]);
        $j(attSpan).parents('div:first').find(".text-danger").remove();
        if ($j(attSpan).find('input[type=file]').hasClass("frm_required_error")) {
             $j(attSpan).find('input[type=file]').removeClass("frm_required_error");
                                    }
    }

    ----------------------------------------

    NOTE: in else statement i have defined binding for attachment as:     var theBinding = 'my:Attachment_1'; you can update this accordingly, rest of the code stays same.

    Hope this helps.

    Regards



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



  • 6.  RE: Evolve Attachment Element properties

    Employee
    Posted 16 days ago

    Hi Kurt.

    Use below code to show attachment as required and set it to not required on field change.

    --------------------------

    var theBinding = 'my:Attachment_1';
    var attachments=  $j('span[binding="' + theBinding + '"]');
    var attSpan = $j(attachments[0]);
    if ($form.getValue('/my:myFields/my:field_4') == 'X') { 
        SVFormInternalAttachmentValidations['my:Attachment_1'].minimum = 1;
        $j(attSpan).find('input[type=file]').addClass("frm_required_error");
        Utils.addMessageToControl($j(attSpan));
    }
    else
    {
        SVFormInternalAttachmentValidations['my:Attachment_1'].minimum = 0;
        $j(attSpan).parents('div:first').find(".text-danger").remove();
        if ($j(attSpan).find('input[type=file]').hasClass("frm_required_error")) {
             $j(attSpan).find('input[type=file]').removeClass("frm_required_error");
                                    }
    }

    --------------------------------

    Hope this helps.

    Regards



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