Topic
  • 1 reply
  • Latest Post - ‏2013-01-30T02:42:19Z by pdubovitsky
cody
cody
104 Posts

Pinned topic highlight the tab if the attachment field has a value

‏2013-01-29T22:31:39Z |
Hello,
I have a problem statement and I am looking for ideas.
ClearQuest 7.1.2.2 Windows full client (possibly using the web in the future - we have CC/CQ UCM integration so that effort is parked right now)

On a CQ form using the out of the box Attachment package for attachments field.

I have a user requirement "Is it possible to highlight the tab if the attachment field has a value (has an attachment)"

Our form has 8 tabs, if the attachment field is filled in they want to bring it to the attention of the user.

I have never seen this, and looking for ideas.

Thank you!
Updated on 2013-01-30T02:42:19Z at 2013-01-30T02:42:19Z by pdubovitsky
  • pdubovitsky
    pdubovitsky
    376 Posts

    Re: highlight the tab if the attachment field has a value

    ‏2013-01-30T02:42:19Z  
    Hello,

    There is no way to highlight a tab unless you initiated some action.
    Highlighted tab means that there are fields on the tab that do not have required value or that did not pass validation.
    What you can do is to add a field validation hook that would not pass validation once during the action (when action is initiated, a validation hook is called).

    Assuming that attachment field name is "Attachments"
    1) add a base action to the record type with the following Action initialization hook
    
    $session->SetNameValue(
    'Attachment', 
    '1');
    

    2) add field validation hook to the "Attachments" field
    
    
    
    if( $session->GetNameValue(
    'Attachment') == 1 )
    { $session->SetNameValue(
    'Attachment', 
    '0'); 
    
    if( $entity->GetAttachmentFields()->ItemByName(
    'Attachments')->GetAttachments()->Count() > 0 )
    { $result = 
    "The field has attachment"; 
    } 
    }
    


    The field validation hook will fail based on the session variable value, once, and then reset the value. It will be sufficient to highlight the field and tab in the beginning of the action, but would allow to submit record later.

    Pavel