We have created a custom htmpl for employee type contacts and show related workflows tasks which are assigned them for approval. We also want them to see change attachments of the related workflow, how can we reach chg attachment from workflow? We do not want those contacts to reach chg object itself.
Update:We manage to show the attachments but we cannot click and see the attachments with following error in std_log and attached error on screen.
Failed to complete reply method: 'MTH::got_parent_info' ,BOP Name:'Attachment id:400352' in class:'CDownloadFile', Error:AHD05072:Security settings prevent viewing this record
Thanks for the replies.
seems like no access to change = no access to change's attachments.
You can try to enable access to Change Orders and disable chg form for specified role. Don't forget to cleanup notifictions, urls and other stuff that can navigate user to chg.
In our env we also do not allow customers to see Change's body, for that purposes I have added followed code that redirects user to assigned workflow from change form:
<PDM_LIST prefix=ztask factory=wf where="status='PEND' AND chg=$args.id AND assignee=U'$cst.id'"> <PDM_IF "$ztask.id" != ""> var url = cfgCgi + "?SID=" + cfgSID + "+FID=" + fid_generator() + "+OP=SEARCH" + "+FACTORY=wf" + "+SKIPLIST=1" + "+QBE.EQ.id=" + "$ztask.id"; display_new_page(url); </PDM_IF></PDM_LIST>
Hope this helps.
Thanks a lot for your reply. Currently i removed every restriction on employee role for chg to be sure that nothing is blocking me. But i still get the same error.
Do you have any suggestion for opposite version of list that you gave. I want employees to reach attachment of cahnge order from detail page of workflow task.
Thnaks in advance
We don't use default attachments logic I can't check this in my env...
But as I remember there is unversal js function to get attachemnt like download_attmnt('<attmnt_persid>'); which generates URL, so you can try to add alerts (or console.log) into it and compare URL from wf and chg which is used to get attachment.
Thanks a lot for your help. I manage to find the solution. The issue was because licensed flag of the employee access type is not marked. When it is not marked system is only allowing user to access its own data and since the attachments we are trying to download are belongs to changes of different users we were getting this error.