Enable to write multiline description in product object

SOLVED

I am tring to write multiline extended description of product but not able to write it using description. i used \r\n and \n for carrige return or line break but it ignored and description come with single line.

Parents
  • +1
    verified answer

    I'm not sure how you are doing this, but you should be able to embed Chr(13) + Chr(10) for carriage return line feed.  Using the item business object that would look something like below (VBScript).  Keep in mind the length of the description needs to exceed 30 characters in length in order to be written as an extended description.

    Set oItem = oSession.AsObject(oSession.GetObject("CI_ItemCode_bus"))

    rVal = oItem.SetKey("NewItem")
    If rVal>0 Then

        crlf = Chr(13)&Chr(10)
        rVal = oItem.SetValue("ItemCodeDesc$", "Line of text 1" & crf & "Line of text 2" & crlf & crlf & "Line of text 4")
        If rVal = -1
            ' extended description will be created when the write occurs 
        end if

        rVal = oItem.SetValue("ProductLine$", "CARD")

        rVal = oItem.Write()

    End If

    Hope this helps

    E

Reply
  • +1
    verified answer

    I'm not sure how you are doing this, but you should be able to embed Chr(13) + Chr(10) for carriage return line feed.  Using the item business object that would look something like below (VBScript).  Keep in mind the length of the description needs to exceed 30 characters in length in order to be written as an extended description.

    Set oItem = oSession.AsObject(oSession.GetObject("CI_ItemCode_bus"))

    rVal = oItem.SetKey("NewItem")
    If rVal>0 Then

        crlf = Chr(13)&Chr(10)
        rVal = oItem.SetValue("ItemCodeDesc$", "Line of text 1" & crf & "Line of text 2" & crlf & crlf & "Line of text 4")
        If rVal = -1
            ' extended description will be created when the write occurs 
        end if

        rVal = oItem.SetValue("ProductLine$", "CARD")

        rVal = oItem.Write()

    End If

    Hope this helps

    E

Children