Sage 100

 View Only
  • 1.  VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 16:19
    Customer uses extended descriptions which include hazardous info, etc. They have the extra info separated by carriage returns, e.g.

    "Regular Description

    :Class code, etc."

    They had to update several items with new class codes and I found a handy KB article about how to import carriage returns with pipe symbols. All looked well until I realized that the regular description now includes the first 30 characters even if there is a pipe symbol separating it.

    Here is the source data: 
    NEUTRAL CLEANER/2x4.5#||:NMF#48580 (CLASS 70)

    And here is the imported data:
    NEUTRAL CLEANER/2X4.5#:NMG#4

    The VI calc is:
    sub(Temp001$,"|",$0d$)
    What exactly is this formula doing and why isn't it working?? I tried just importing in the regular descriptions but then the extended descriptions are disappearing (not all but some). 

    HELP!!



    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------


  • 2.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 16:29

    The formula is just replacing all occurrences of the "|" with a Carriage Return (ASCII 13).

     

    It also sounds like the standard description (first 30 characters) will display the first 30 characters inline regardless of special characters within it.

    If you click the ext desc button in item maintenance/inquiry, is the full description displayed correctly?

     

    If they absolutely do not want whatever follows the first carriage return to be displayed in the first 30 characters of the standard description, then it sound like you will need to pad anything found before the first carriage return to 30 characters so everything after that goes to the extended description.

     

    Off the top of my head, I do not know whether it will attempt to trim (remove excess spaces) between the valid description and the first carriage return if you were to pad with spaces. I know I have seen it trim just spaces from a field before.

     

     

     

    Thanks

    David Speck

    TSS

    Sage | Sage 100 Certified Consultant

     



    ------Original Message------

    Customer uses extended descriptions which include hazardous info, etc. They have the extra info separated by carriage returns, e.g.

    "Regular Description

    :Class code, etc."

    They had to update several items with new class codes and I found a handy KB article about how to import carriage returns with pipe symbols. All looked well until I realized that the regular description now includes the first 30 characters even if there is a pipe symbol separating it.

    Here is the source data: 
    NEUTRAL CLEANER/2x4.5#||:NMF#48580 (CLASS 70)

    And here is the imported data:
    NEUTRAL CLEANER/2X4.5#:NMG#4

    The VI calc is:
    sub(Temp001$,"|",$0d$)
    What exactly is this formula doing and why isn't it working?? I tried just importing in the regular descriptions but then the extended descriptions are disappearing (not all but some). 

    HELP!!



    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------


  • 3.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 16:38
    Well @Kevin Moyes your formula now brings it in as ​"NEUTRAL CLEANER/2X4.5#:N" so it eliminated some of it but not all. And yes, @David Speck II the extended description is perfect, just not the 30 character regular description. And padding didn't do the trick. Any other thoughts??

    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------



  • 4.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 16:42
    If you go into the extended description and make any sort of change and click OK, the regular description is then correct. There are 120+ items and I don't really feel like go into each extended description to correct them. 

    Oddly enough, when I tried importing just the regular descriptions, it worked for some items but not for others i.e. some reg. desc's held and the ext'd was the same but for others, the ext'd desc. disappeared. I'm thinking for items with reg. desc's <30, they disappeared?

    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------



  • 5.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 23:52
    This appears to be caused by the way VI handles item code descriptions, which behaves differently then if you were to modify the extended description in Item Maintenance.
    Item Maintenance appears to trim the standard item code description to either before the first occurrence of a carriage return or to 30 characters.
    VI only trims the standard item code description to 30 characters.
    This can be worked around with either perform logic on the before write and after write of the item code description or by appending additional statements to the field calculated statement as seen in the following screenshots.

    This first ItemCodeDesc element replaces any occurrences of "^" with a carriage return and then trims the standard description to before the first occurrence of a carriage return if it exists in the description or 30 characters.
    SUB(IMP$[2],"^",$0D$); IF POS($0D$=VAR$)>0 THEN VAR$=MID(VAR$,1,POS($0D$=VAR$,1,1)-1) ELSE VAR$=MID(VAR$,1,30) END_IF​

    The second ItemCodeDesc element then checks whether or not the original string in the source column indicated by the number between the square brackets following IMP$ contains a carriage return or is longer than 30 characters. If either condition is met, the string then has any occurrences of "^" replaced with a carriage return and is then set into the coBusiness'ExtDescriptionText$ property so the business object handles it the rest of the way properly.
    {CI_Item.ItemCodeDesc$}; IF LEN(IMP$[2])>30 OR POS("^"=IMP$[2])>0 THEN coBusiness'ExtDescriptionText$=SUB(IMP$[2],"^",$0D$) END_IF​


    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 6.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-06-2019 08:58
    Thanks for all the work @David Speck II but I'm getting a syntax error on your first calculation above. ​


    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------



  • 7.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-06-2019 12:27
      |   view attached
    I've attached a text file containing both expressions. See if they work for you. There is a chance a character is being substituted when displayed via the web.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------

    Attachment(s)

    txt
    Ext Desc Calculations.txt   252 B 1 version


  • 8.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-14-2019 13:13
    Is it working @Therese Logeais?​

    ------------------------------
    Robert Wood
    Consultant
    90 Minds, Inc.
    Ocala FL
    352-615-5898
    ------------------------------



  • 9.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-14-2019 13:22
    Somewhat but the customer is now good.

    ------------------------------
    Therese Logeais, Technology Integrators
    ------------------------------



  • 10.  RE: VI to import IM extended descriptions without replacing the regular descriptions

    Posted 11-04-2019 16:29
    Edited by Kevin Moyes 11-04-2019 16:29
    Sub is character replacement... here is what we use (with "^" instead of your "|" which can cause issues). 



    (I'm not sure what your $0d$ does).


    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------