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

  • 0 in reply to jepritch

    Thanks Jepritch,

    I am doing same thing using C#. and value we is  like 

    String Desc = "Test Description Line1 \r\n Test Desciprtion Line 2 ";

      rVal = oItem.SetValue("ItemCodeDesc$", Desc )
        

    Thanks but it's not working as extected.

  • 0 in reply to Rahul Bhadani

    Do a find and replace on \r\n to use what Elliott says.  Sage doesn't recognize "\r\n" as special characters... it's just text.

  • 0 in reply to Kevin M

     can you please let me know what need to be replace "\r\n".

Reply Children