can help offer suggestion if i want check parts field on title block, and it can grap value and show newly rule while click SAVE

i have a question is check filed on title block while click SAVE bottom,

we have one list field(A1) and one text field(A2), when we choose the list(A1) values is “OTHERS”, and we want check if user write something on text(A2), if not we need show error when click SAVE, and if user modify also recheck again when click SAVE.

 

what event i can use ?

i’ve try event type: update title block, i stuck in when user modify by follow the  error message and than click SAVE button, also show the same error, the script keep the first time value, never refresh the new modify value.

any suggestion i can do ? thanks

Agile User Asked on May 5, 2023 in Engineering Collaboration.
Add Comment
1 Answer(s)

You would need to set this up as a Synchronous, Pre Trigger Update Title Block event.  During the Pre-Event, you would need to fetch the IEventDirtyCell for each attribute A1 & A2 and then triage from there.  Throw a new Exception if IEventDirtCell for A2 is null (meaning its not updated) which will error the “Save”

 

IDataObject ido = uEvent.getDataObject();
IAgileClass cls = ido.getAgileClass();

IAttribute a1Att = cls.getAttribute(“A1AttributeID”);
IAttribute a2Att= cls.getAttribute(“A2AttributeID”);

IEventDirtyCell a1EDC= uEvent.getCell(a1Att.getId());
IEventDirtyCell a2EDC = uEvent.getCell(a2Att.getId());

if(a1EDC.getValue().ToString().contains(“OTHERS”) && a2EDC ==null){

//A1 is set to others but A2 is not modified

throw new Exception( “A1 is set to others but A2 is not modified. Please try again”_;

}

Agile Talent Answered on May 9, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.