Clarity

  • 1.  Reduce custom attribute field length

    Posted Mar 05, 2018 01:57 AM

    CA-PPM 14.3

     

    I have a custom attribute with string data type with maximum size 80 characters length.  

     

    Is there anyway, I can reduce the max size to 30 characters?

     

    Note:  This is a custom object and there are thousands of records already in the table.

     



  • 2.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 02:57 AM

    Have you tried changing the Width of the attribute from the View > Fields part of the object ?

     

    NJ



  • 3.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 05:59 AM

    Hi NJ

     

    I think, the width is only for reducing the display width.  But i need to restrict the number of characters to 30



  • 4.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 04:05 AM

    The application and the underlying database will not let you do this (since it is protecting you from losing data in the 50 characters that you are going to truncate).

     

    So the way to do this is create a new attribute of 30 characters, migrate all your data (via XOG or SQL if you are happy to accept the "unsupported" route), delete your old attribute and replace it on views with the new attribute

    ( if you have a lot of downstream code referencing the old attribute name then you probably want to do it all again* to get back to the original name. Do not even think about deleting attributes / renaming attributes at SQL level as you will definitely break the application that way, only do this via the application. )

     

    --

     

    * - I suppose if you are happy with SQL, you could copy all the data off to a temp area, delete the attribute (in the application), create a new replacement attribute with the same name (in the application) and copy the data back from your temp area in SQL. That would save you a few steps.



  • 5.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 06:08 AM

    Okay. Thanks David for your advice.  I see a lot of work on creating new attribute and migrating the data from old attribute and modify the custom process to reference the new attribute and list the goes on.

     

    For a quick fix, I'm thinking of alerting the user to enter max. 30 characters by using Hint and Tool tip

     

    Thanks



  • 6.  Re: Reduce custom attribute field length

    Broadcom Employee
    Posted Mar 05, 2018 06:00 AM

    Hi Venkitta

     

    It cannot be done from UI but that number is just not enough, you need to change the database size too. Also you need to find out if existing data is below that length and manage the data. 

     

    Dave approach is best which I feel

     

    Regards

    Suman Pramanik



  • 7.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 06:09 AM

    Hi Suman

     

    I agree with Dave



  • 8.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 08:02 AM

    Be careful, "name" is NOT a custom attribute. It may be the "name" field of a "custom object" but it is created and handled by CA PPM.

    You cannot alter ID and NAME size but you can, as previously mentioned, adjust view settings.

    I would NOT make any changes to the database as well, as this may get you in trouble with your next patch/upgrade.

    If you REALLY need an attribute with a smaller size, create a new attribute with the size you want, and use that attribute instead of NAME. You may leave name auto-numbered, read-only or hidden, as it is required, and you would have to adjust filters, queries, portlets and reports to use your new attribute, instead of NAME. 

    This is the same approach as mentioned by Dave above, except for the fact that you cannot delete "NAME" as it is a standard attribute even for custom objects.

    Again, only if that is really necessary...



  • 9.  Re: Reduce custom attribute field length

    Posted Mar 05, 2018 08:58 AM

    ^ ahh good spot ; I assumed we were talking about a custom field. Ooops.