Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
bpmuserid

New Member
Registered:
Posts: 1
Reply with quote  #1 
Hi All,

  I have a clip field added to the bpm Form to attach relevant files. I wanted users to only 'Add' or 'Open' the attachments. 'Delete' option should not be available so that none of the attachments added will be deleted anytime.
Is there a way to hide or disable the 'Delete' option of Attachment 'Clip'

Any help is highly appreciated.

Best Regards.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
Not in any supported manner, although someone may be able to figure out a hack.

A Mult-attachment field may be read-only or editable. If editable, users may add or delete any files attached to that Folder, even if the attachment was added to a single-attachment field.

Just one of the reasons Multi-attachments fields do not meet most requirements, IMO.


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #3 
Here is an unsupported client side hack to disable the delete attachment capability

function DisableAttachmentDelete(AttachmentGridName, DontShow)
{
    var attch = document.getElementById(AttachmentGridName);
    if(!attch) return;
    if(DontShow)
    {
        attch.rows[0].cells[2].innerHTML=' ';
    }
    else
    {
        attch.rows[0].cells[2].innerHTML='<a href="#" onclick="return doAttachmentAction(this, 3)"><img src="images/AttachmentGrid/deleteDisabled.gif" style="border:0px;width:23px;height:22px" alt="Delete" /></a>';
    }
}

 
Call it with a form load client script (Delete icon shown disabled)
    DisableAttachmentDelete('MyAttachments');
Or (Delete icon not shown)
    DisableAttachmentDelete('OtherAttachments', true);



__________________
Your best practice does not conform with my best practice.
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #4 
hi,

i have crated this procedure and tested the Delete Attachment but I don't know where i am going wrong since it is not working.

i am still able to delete, after attachment is done.


 
Attached Files
xep DeleteAttachment.xep (2.01 KB, 12 views)


__________________
masroor

0
KDR

Member
Registered:
Posts: 18
Reply with quote  #5 
You have missed the quotes around the clip name in the function call.
You have:
    OnLoad=DisableAttachmentDelete (Clip1, true)&Language=JScript

Shoud be:
    OnLoad=DisableAttachmentDelete ('Clip1', true)&Language=JScript
  
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #6 

hi,

It has worked with DeleteAttachment.xep, but when the same i am trying to do with this remittance.xep it is failing infact OnLoad is not executing any other script also.

Attach is the xep.

any help with this will be highly appreciated.


in order to run

u need first publish these .xel files

----

This is developed in metastorm 7.5

 
Attached Files
xep remittance.xep (74.75 KB, 12 views)
xel T24Connectorwsdl.xel (9.85 KB, 7 views)
xel Sample_Library.xel (36.44 KB, 7 views)


__________________
masroor

0
mohnshine

Avatar / Picture

Senior Veteran
Registered:
Posts: 270
Reply with quote  #7 

The problem is not the script provided but your accountXML script, specifically the following line

ework.ExecSQL("insert into remittance_accounts_by_folder(map_name,folder_id,account_number) values (eworkGetField("%mapname",""),eworkGetField("%folderID",""),accountNumber)");
 
When you have a problem with client side scripting, I suggest turning on notifications about scripting errors in the client.  You can also load the form in a browser window with a status bar and then double click on the javscript error indicator to get an idea of where the error is occurring.

BTW, I think that you want accountXML to be a server side script not a client side script.


__________________
Your best practice does not conform with my best practice.
0
masroorahmedkhan

Veteran
Registered:
Posts: 113
Reply with quote  #8 
hi,
 
Thanks very much for the udpate,
 
infact the script DisableAttachmentDelete was common for all the forms the only change I did and it start working is i made it common to each form and i created similare script for other form where the clip control is and it worked.
 


__________________
masroor
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #9 
equally unsupported and hacky equivalent for v9

var parent = document.getElementById("<clipname>_Editor")
      .getElementsByTagName("table")[0]
      .getElementsByTagName("thead")[0]
      .getElementsByTagName("tr")[0]
      .getElementsByTagName("td")[0]
      .getElementsByTagName("div")[0];
      
var inputList = parent.getElementsByTagName("input");
 
for (var i=0; i<inputList.length;i++) {
      if (inputList[i].getAttribute("title") == "Delete") {
            parent.removeChild(inputList[i]);
      }
}
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!