cancel
Showing results for 
Search instead for 
Did you mean: 

how to lock attachments in Rfx

Former Member
0 Kudos


Hi experts,

how to lock RFx attachments, while Rfx doc on save.

Find the attachment

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Experts ,

I have a query on how to restrict access to attachment in a document using script .Is there are way to throw an exception if a particular user or group tries to access attachment link in the toolbar .

Best Regards,

Piyush

Former Member
0 Kudos

Hello Sourcing Experts!

I have the same need as Piyush.  I've tried changing the access rights settings to 'deny' for:

-Document Management - Attachment Library (all listings)

-Document Management - RFx Attachments Library (all listings)

Unfortunately for the user I gave this profile to they are still able to see all RFx attachments from both the Owner and suppliers.  If there is a configuration setting im missing please share .  If this is a possibility via scripting, please advise.

THANK YOU!

kushagra_agrawal
Active Participant
0 Kudos

HI Kp,

I am assuming you need to lock "Attachments" Tab at the toolbar level. According to my understanding we cannot lock the "Attachments" Tab but we can restrict the user to add attachments on save by writing a small script at validate event. The script will force the user to remove any attachment added depending upon the conditions.

If you can illustrate your business case i-e on what scenarios you want to restrict the user to add attachments then experts on the forum can give you the insight to achieve it.

Let me know if I got your requirement correctly.

Best,

Kushagra A

Former Member
0 Kudos

Hi Kushagra,

Thanks for your reply.

Yes your correct, if you know the script let me know.

Regards,

KP

kushagra_agrawal
Active Participant
0 Kudos

Hi KP,

As I mentioned before, Script should have a condition depending  on what basis you want to restrict the user to add any attachment so you need build that logic.

Lets say you don't want the user to upload any kind of attachment, then below piece of code should work:

//

attachmentColln=doc.getAttachments();

size=attachmentColln.size();

if(size!=0)

{

throw new ApplicationException("You are not authorised to add any attachment");

}

Hope it helps!

Best,

Kushagra A

Former Member
0 Kudos

Hi Kushagra,

Thanks for reply.

this script smehow will help but not exactly.

can you imrovise this.

Regards,
KP

kumar3kpk@gmail.com


Former Member
0 Kudos

this is my req

Regards,

KP

Former Member
0 Kudos

Hi KP,

I understood your requirement in this way : You have created RFX and attached some files in attachments tab, then when you save the RFX, attachments tab Add/Edit/Delete option should be locked. So that no body can add attachments to the saved Rfx.

For this requirement write script on collection validation, i have tried same and able to hide Add/Delete/Edit option of attachments tab for saved Rfx. Below is the code snippet.

Code Snippet:

attachments = doc.getCollectionMetadata("DEFAULT_ATTACHMENTS").get(doc);

size1 = attachments.size();

if(size1 > 0)

{

for (int i = attachments.size() - 1; i >= 0; --i)

{

IapiDocumentLockManager.lockField(session, doc, "DEFAULT_ATTACHMENTS");

}

}

If you implement above script no body can Add/Delete your attachments in saved Rfx.

Let me know if my view was wrong about your requirement and let us know the exact requirement.

Regards,

Lava