Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
1845 views

Make attachments mandatory (SM 7)

Jump to solution
Hi all,

I want to make that the users who want to request a Change have to attach a document (MANDATORY).

I have seen the field, but O don´t know how to make it mandatory.
Can anyone help me?.

Regards,
Sonia.
0 Likes
21 Replies
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
Can you show me what you did? The solution I described I set up on a test system, and it was working...

Where are you having trouble?
0 Likes
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
We did what you told...

In the cm3r format control, in Queries:

Update: true
Delete: true
Filename: SYSATTACHMENTS
Query: application="cm3r" and topic=number in $file

In our case query number is 3.

In Validations:
Update: true
Delete: true
Validation: not null($file3)
Message: Insert a file

Now, we create a Change without an attachment, and a pop-pop showing the message. We insert an attachment, but pop-up is displayed again.

It is like the attachment insertion is not checked again.

Regards.
0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
Ok, try this:

In your Calculations panel of the cm3r formatctrl, add the following:

Update: true
Delete: true
Calculation: if (not null(contents($file3))) then ($attachment=true) else ($attachment=false)


Then, in the Validations panel, change the validation to:

Update: true
Delete: true
Validation: $attachment=true
Message: Please provide the Attachment


I've just re-verified that this works on my system.

View solution in original post

Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
Hi again Jacob,

I have tried your help, without results...

The problem occurs when I creata a NEW change (because with old changes works fine). I have used RAD debugger, and it seems attachment is nos detected until is the change is saved. The value of $attachment is the same in the change if the attachment is or not.

Did you try it with a new change or with a created one?.

Regards,
Sonia.
0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
See my first post in this thread.
0 Likes
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
Oh, I know...

but with your instructions, change cannot be saved, because it the file is attached or is not, the pop-up message is displayed...
0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
From first post:

You could set this up so the change can't move out of the first phase by doing the following.

In the cm3r formatctrl record, in the Queries panel, add the following:

Update: true
Delete: true
Filename: SYSATTACHMENTS
Query: application="cm3r" and topic=number in $file
0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
I don't see any validations (that I gave you) that check on Add... all of them are on Update or Delete
0 Likes
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
Hi Jacob,

so, do you mean, your help only works when you uodate or delete a change, don´t you?.

Regards,
Sonia.
0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral
Yes:

"Note: You cannot add an attachment to a record before you save it. Service Manager can attach files only to an existing record in the database."
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.