validation on attachment

Hi Gurus,

 

Can i put a validation on attachment in SD & IM created, that it can’t be deleted once it is attached. Another/Correct one can be attached along with existing one.

Tags:

  • Hi again,

     

    It seems that you can try also using a format control query of the SYSATTACHMENT table which is the validated by a status dependent validation. A further suggestion of validating the uploader of the attachment was also suggested as a possibility.

     

    This isn’t available out of the box but you should be able to tailor something to suit your needs. You didn’t mention which SM records you are working with so I will assume it is Incidents, although the principle would be the same for any.

    You should be able to make a query from the Queries section of the probsummary format control to the SYSATTACHMENTS table to check that it contains records where the topic of the SYSATTACHMENTS record equal the number of the Incident record. This can then be used in the Validations of the format control record using not null(contents($file#)) where # is the actual file query number from the format control query. So if it was the third query (from top to bottom) on the format control queries page then the file variable would be $file3.

     

    Please check also this discussion:

     

    http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/Make-attachments-mandatory-SM-7/m-p/4436449#M25415

  • Hi Thanks for your reply.

     

    I am with HPSM can u pls brief me in steps how can we disable/hide remove option in attachment filed with all modules (SD,IM,CM,PM).

     

     

  • Hi,

     

     I can provide it right now for the change management as it was done. So for incident you will have to chenage for probsummary.

    So thsi is what I found:

     

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

    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

    Take note of which Query entry this is. In an OOB SM7 system with the IIA Implementation, I _think_ this is query number 7 (count the number of entries in the "Add" column).

    Then, in the Validations panel, do the following:
    Update: true
    Delete: true
    Validation: not null(contents($file7))
    Message: Please provide an attachment for this Change request.


    Keep in mind, though... if _every_ change request requires an attachment, you'd better have hard-drive space, or a plan for removing attachments from closed Changes.

  • Hi,

     

     I can provide it right now for the change management as it was done. So for incident you will have to chenage for probsummary.

    So thsi is what I found:

     

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

    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

    Take note of which Query entry this is. In an OOB SM7 system with the IIA Implementation, I _think_ this is query number 7 (count the number of entries in the "Add" column).

    Then, in the Validations panel, do the following:
    Update: true
    Delete: true
    Validation: not null(contents($file7))
    Message: Please provide an attachment for this Change request.


    Keep in mind, though... if _every_ change request requires an attachment, you'd better have hard-drive space, or a plan for removing attachments from closed Changes.

  • Hi,

     

     I can provide it right now for the change management as it was done. So for incident you will have to chenage for probsummary.

    So thsi is what I found:

     

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

    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

    Take note of which Query entry this is. In an OOB SM7 system with the IIA Implementation, I _think_ this is query number 7 (count the number of entries in the "Add" column).

    Then, in the Validations panel, do the following:
    Update: true
    Delete: true
    Validation: not null(contents($file7))
    Message: Please provide an attachment for this Change request.


    Keep in mind, though... if _every_ change request requires an attachment, you'd better have hard-drive space, or a plan for removing attachments from closed Changes.