Make an attachment required

  • 19 April 2016
  • 8 replies
  • 4 views

Badge +4

I am trying to display a message if there is no attachment on this form.
16266i418D9A4345FD0115.png
I have tried the above but it always shows that the File File Attachment value is empty, I think because the attachment doesn't truely exist until the "On WellnessSubmissions Attachments List, when Save ToolBar Button is clicked rule".

Any recommendations on how to make an attachment required?


8 replies

Userlevel 3
Badge +8

Dear ,

 

Just to understand u more , ur attachment control , is it on editable list or item view ?

have u tried using the "If form passes validation" and check the attachment control to make it required?

have u tried "advanced condition" and check if attachment control isnt empty ?

 

Regards.

Badge +4

Thanks for your response, this is for an item view.
I have tried the following validation with both the required and valicate boxes checked:
12238iC5CEC099F8F8BBD0.png



First transfer of data sets HasAttachment to Yes, and the else sets it to no.

I have bound this rule to my submit button so that it will check for attachments and if the value of HasAttachment is no it will show a message saying an attachment is requires rather than executing the create list item method.

Userlevel 3
Badge +8

Dear ,

 

May i ask u to try using the control itself ? instead of using the SMO property ?

pictures r kind of hard to see for me honestly , but i saw that u r using the SMO file property in ur Advanced condition ,

could u change that and expand the item view ---> controls --> the file attachment control itself ,

if (control isnt empty)

tran

else

tran

 

Note: if i may suggest 1 thing , please create a new view , and test these rules out , just to avoid any conflict in rules that u might have in ur form and to test it out in a clear / new view , just add file attachment control and button , and show msg on button click to say true/false if attachment has value or not .

 

Regards

Ahmad Yaqub

Badge +4

use ctrl + to zoom in and ctrl 0 to reset your zoom, the resolution is there in the pictures, the site just formats them funky.

Userlevel 3
Badge +8

dear ,

 

wts confusing me is the question i asked earlier , is it item view or list view ...

u told me its item view , but from wt i see its a list view , please confirm which one is the view u r using .

 

regards.

Badge +4

I am sorry, you are correct, the Wellness Submissions Attachments is a list view.
I am not familiar with using controls, I tried using File File attachment >File Name and that doesnt seem to contain data when I have added an attachment.
Can you recommend a control to use?
15209iE4A5FD99936CCEAF.png

Userlevel 3
Badge +8

Dear

 

Im nt rly sure how u use it to save records cuz there r different ways to do ,

but wt u need to validate is the add/edit row control , its the control itself in edit mode ,

validate the file attachment to prevent users from saving with empty attachment .

 

hope it helps!

regards.

Badge +4

I figured out a different method using For-Each Looping.

I changed my Check for Attachment rule to the following:
11941i706DB527A4FB02AF.png

The first transfer data sets HasAttachment to no, then for each item in the list it truns the value to yes. That way if they attach an item and delete it after fixing some other validation error it will reset to no before checking for an attachment.
Which in my case, I just need at least one attachment so this method works.

Thank you for pointing out the list view, it lead me to use this method instead which works great!

Reply