Its a continuation from my last post in which a record is not in certain user's assignment, then it cannot be edited. Only assigned user can edit that record.
But there is one problem, the users cannot edit PR record but they can edit attached docs associated with corresponding record and it doesn't apply on attached documents. Because technically, the attach docs object is different.
We have implemented this requirement with different object event condition (using doclinks, pr and wfassignment objects) using automation script on Purchase Requisitions Application.
Object Launch Point : DOCLINKS
Script : Jython
Object Event Condition:
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
AND ownerid in (select prid from pr where prid =:ownerid) )>0
and
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
and assigncode IN (:&USERNAME&) AND ownerid in (select prid from pr where prid =:ownerid) )=0
Events: Save, Add, Update, Delete, Before Save
Create Error Message:
Create error message in database configuration, errorgroup = 'DOC' and errorkey = 'DOC-ASSIGN'
Source Code:
errorgroup = 'DOC'
errorkey = 'DOC-ASSIGN'
But there is one problem, the users cannot edit PR record but they can edit attached docs associated with corresponding record and it doesn't apply on attached documents. Because technically, the attach docs object is different.
We have implemented this requirement with different object event condition (using doclinks, pr and wfassignment objects) using automation script on Purchase Requisitions Application.
Object Launch Point : DOCLINKS
Script : Jython
Object Event Condition:
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
AND ownerid in (select prid from pr where prid =:ownerid) )>0
and
(select count(ownerid) from wfassignment where ownertable='PR' and assignstatus='ACTIVE'
and assigncode IN (:&USERNAME&) AND ownerid in (select prid from pr where prid =:ownerid) )=0
Events: Save, Add, Update, Delete, Before Save
Create Error Message:
Create error message in database configuration, errorgroup = 'DOC' and errorkey = 'DOC-ASSIGN'
Source Code:
errorgroup = 'DOC'
errorkey = 'DOC-ASSIGN'
No comments:
Post a Comment