Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

TyptTo in Macro, Data being truncated

Posted on by 65

Hope someone can help. I've got a Macro I need to populate a po in GP. Everything works perfect except the text I try and type into the comment section get''s cut off at some random spot. Are there any specific rules to using the "TypeTo" command?

Here's a example....

NewActiveWin dictionary 'default'  form 'POP_Comment_Entry' window 'POP_Comment_Entry' 
  MoveTo field 'Comment Text'
  TypeTo field 'Comment Text' , 'SHELL: 72" OD X 4~" X 1/2", SA-516-70N-SINGLE OUTSIDE 30 DEGREE BEVEL;-NO LAND (CIRC SEAMS); SINGLE OUTSIDE 30 DEGREE BEVEL -NO LAND, 1/8" GAP (LONG SEAM)'
  MoveTo field 'OK Button K'
  ClickHit field 'OK Button K'

So I would expect to see this in the comment window

SHELL: 72" OD X 4~" X 1/2", SA-516-70N-SINGLE OUTSIDE 30 DEGREE BEVEL;-NO LAND (CIRC SEAMS); SINGLE OUTSIDE 30 DEGREE BEVEL -NO LAND, 1/8" GAP (LONG SEAM)

but get this

SHELL: 72" OD X 4~" X 1/2", SA-516-70N-SINGLE OUTSIDE 30 DEGREE BEVEL;-NO LAND (CIRC SEAMS); SINGLE

*This post is locked for comments

  • Dave May Profile Picture
    Dave May 65 on at
    Re: TyptTo in Macro, Data being truncated

    Leslie,

    I'm on version 11.00.1860. We just went "live" with GP so all of this is new.

    I've made a little progress. I tracked the comments to a table [POP10550] it looks like it splits the comment into 4 char(51) fields as well as keeping a copy in a text field (which is an old format). I tried spliting the same comment into lines and it works. I'm sure that if I tried enough different strings I would get some truncating but this should work for now.

    NewActiveWin dictionary 'default'  form 'POP_Comment_Entry' window 'POP_Comment_Entry' 
    MoveTo field 'Comment Text'
    TypeTo field 'Comment Text' , 'HEAD:(2) 72" OD X 2:1 S:E X 2" SF X 5/8" NOM (0.53125" MIN);'
    TNT_Event , '090039025100000000000200001ED9AA60ED' # cntrl chr
    TypeTo field 'Comment Text' , 'SA-516-70N; SINGLE OUTSIDE 30 DEGREE BEVEL; NO LAND'
    TNT_Event , '090039025100000000000200001ED9AA60ED' # cntrl chr
    TypeTo field 'Comment Text' , '(CIRC SEAM); HOT FORMED'
    MoveTo field 'OK Button K'
    ClickHit field 'OK Button K'

  • L Vail Profile Picture
    L Vail 65,271 on at
    Re: TyptTo in Macro, Data being truncated

    Dave,

    You're right about the copy and paste. It works every time in the non-macro real life world. I tried to use the paste command with the macro. The first couple of times it was no problem. Then I started getting an error saying the command had been disabled. When I lowered the character count, the error went away. I slowly increased the character count and then it was doing the paste with no problem.

    I couldn't get it to consistently error out on me, so I couldn't pinpoint the problem. The problem is definitely there. I also tried using a saved (blank) comment ID. That didn't seem to matter either.

    Have you been doing this before and it just stopped working? What build are you running? I'm on 11.00.2044, which I think is the most current.

    Kind regards,

    Leslie

  • Dave May Profile Picture
    Dave May 65 on at
    Re: TyptTo in Macro, Data being truncated

    Hi Leslie, thanks for the reply.

    It's odd because I thought that at first too but I was sure I wasn't getting the same number of characters every time, it depended on the string I was passing. I'll have to go back and check. I know for sure that you can copy paste that same string no problem and it saves. At first I got tripped up by the ' being in my string, hence the ~". I also made sure to strip out any returns, tabs etc..

    Hmmmmmm

  • L Vail Profile Picture
    L Vail 65,271 on at
    Re: TyptTo in Macro, Data being truncated

    Hi Dave,

    It's odd that it allowed 99 characters. When I tried running the macro with various lenghts of messages , including yours, it would cut off at 80 characters. That made sense to me only because Report Writer can only handle an 80 character string.

    I did it 12 times, and every time it was 80 characters (once it was 79). I used different text each time. I know it doesn't solve your problem, but I'm not surprised it is a problem. I tried some other Comment text fields and got the same result, 80 characters.

    This isn't the behaviour I was anticipating, but it's consistent. If you measure some of your other comments, do they cut off at 80 characters?

    Kind regards,

    Leslie

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans