Maximo Open Forum

 View Only
  • 1.  Continuing Description field over to Long Description

    Posted 12-04-2023 14:15

    Is there a solution for continuing (spilling over ) a description field (+100 characters) over into the long description field, whether typed in or copied and pasted?


    #Administration
    #Customizations
    #EndUser
    #EverythingMaximo
    #MaximoUserGroups
    #WorkManagement

    ------------------------------
    Stevie Holloway
    Tufts University
    ------------------------------


  • 2.  RE: Continuing Description field over to Long Description

    Posted 12-05-2023 13:21

    Not a good way in the classic Maximo applications. You could create a non-persistent description attribute that is a CLOB and then parse the first X characters to copy over to the description field. But if you try putting 101 characters in a 100 character field the framework will throw an error prior to any validation I believe.

    In the MAF framework, this could be done easier with local attributes that you then split into the datasource attributes. We were even doing this on the worklog feature of technician but stopped doing it after some customers wanted to be able to specify how they wanted the data stored. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: Continuing Description field over to Long Description

    Posted 12-06-2023 08:40

    Another option would be to type into the Long Description and parse out the first 100 characters into the Description. You would not need to have another attribute for this.



    ------------------------------
    Sid Ogden
    GDIT
    ------------------------------



  • 4.  RE: Continuing Description field over to Long Description

    Posted 12-06-2023 10:04
    Edited by Jan Ondrušek 12-06-2023 11:30

    How about this automation script solution? 

    (example for work log)

    AUTOMATION SCRIPT
    -----------------
    AUTOSCRIPT: WLDESC
    DESCRIPTION: WORKLOG - Add description from long_description
    LANG: python
    code:
    ------------
    from psdi.mbo import MboConstants
    from psdi.mbo import MboSet
    from psdi.util import HTML
    worklog = mbo.getThisMboSet()
    if(worklog is not None and worklog.getMboValueData("DESCRIPTION").isNull()):
    descriptionLongDescription = HTML.toPlainText(worklog.getString("DESCRIPTION_LONGDESCRIPTION"))
    description = descriptionLongDescription[0:99]
    worklog.setValue("DESCRIPTION", description, MboConstants.NOACCESSCHECK)
    ---------------
    LAUNCHPOINTNAME: WLDESC
    OBJECT: WORKLOG
    Event: Save , Add, Before Save

    =====================================

    enter long text to long_description field and save SR.

    Result


    ------------------------------
    Jan Ondrušek
    ------------------------------



  • 5.  RE: Continuing Description field over to Long Description

    Posted 12-06-2023 11:12

    Thank you all for your suggestions.



    ------------------------------
    Stevie Holloway
    Tufts University
    ------------------------------



  • 6.  RE: Continuing Description field over to Long Description

    Posted 12-07-2023 10:19

    I guess another option that nobody suggested is that you could increase the length of the description field to the maximum allowable for that datatype..

    which for Oracle would be 2000 characters.

    then in the application designer change the description to a multi-line text box instead of just a text box.



    ------------------------------
    Stephen Hume
    Sheffield Scientific LLC
    ------------------------------



  • 7.  RE: Continuing Description field over to Long Description

    Posted 12-07-2023 09:49

    Recently I had a project where I needed to take the first three hundred characters of the long description and put it into another field.

      The important thing is that when putting long description into an alphanumeric field, you need to strip off the rich text and html symbols (which this script does)
    Here is the source code for that script:
    # -----------------------------------------------------------------------------------------
    # Author: Stephen Hume
    # Creation Date: Oct 29,2023
    # Description: Copy long description to scope of work for new SWP Application
    # This will be triggered by an action in the application
    # -----------------------------------------------------------------------------------------
    from psdi.server import MXServer
    from psdi.mbo import MboConstants
    from psdi.util import HTML
    #create copy of the first 300 characters of the long description as plain text
    if ( LD and len(LD) > 0 ) :
        #strip RTF and set values
        strlongdesc = LD.replace("<!-- RICH TEXT -->", "").replace("</p>", "\n").replace("<br />", "\n").replace("<[^>]+>", "").replace("<b>", "").replace("</b>", "")
        newstrlongdesc = HTML.toPlainText(strlongdesc)
        mbo.setValue("ATH_SWP228",newstrlongdesc[0:300], MboConstants.NOACTION and MboConstants.NOACCESSCHECK)


    ------------------------------
    Stephen Hume
    Sheffield Scientific LLC
    ------------------------------