- This topic has 3 replies, 2 voices, and was last updated 2 years, 1 month ago by Nathan S..
-
AuthorPosts
-
13 March 2024 at 9:39 am #8402MSMichael S.
When receiving inventory, I’m attempting to print the Warehouse Receipt Doc Number (WH-RCPTxxx) number on the label. At the point we have the label printing, no transaction has been posted so we can’t use an Item Ledger Entry, etc. so i need to extract the document number that’s currently on the screen on the scanner.
I got an initial whif of being able to use cuSessionHelper.GetValue(‘Warehouse Document No.’) to get the value from the current Session, however no matter where i use that in the AL code for the report, it comes back blank.
Has anyone seen this before or does anyone have documentation on the cuSessionHelper.GetValue() method?
13 March 2024 at 11:39 am #9762NSNathan S.Insight WorksHi Michael,
There could be a couple things going on here.
The first issue could be that the value is truly empty. “doc_num” may be the variable you want to copy from the session. I don’t think this is the issue, but could certainly be part of it.
More likely, you need to use the GetExtendedValue procedure with a CopyStr
<div>
<div> CopyStr(cuSessionHelper.GetExtendedValue(‘doc_num’), 1, MaxStrLen(lcodDocNumber));</div>
</div>
If this doesn’t get you a solution, please submit a ticket to su*****@*******ks.comRegards,
Nathan Silverman
Insight Works Consultant
13 March 2024 at 11:58 am #9763MSMichael S.Nathan, many thanks for the suggestion. For some additional context, here’s what I had:
<div>
<div>lcodDocNo := CopyStr(lcuSessionHelper.GetValue(‘Warehouse Document No.’), 1, MaxStrLen(lcodDocNo));</div>
</div>
<div></div>
<div>lcodDocNo is defined as a gloabal variable in the report.</div>
<div></div>
<div>One thing that you specifically mentioned and that I also picked up on when reviewing other reports was the difference between .GetValue() and GetExtendedValue(). Is there a guide on what those two methods do (and the differences between those)?</div>
<div></div>
<div>Also, is there a list of the valid “session variables” that exist during a session?</div>23 September 2024 at 9:30 am #10035NSNathan S.Insight WorksApologies for losing sight of this.
By default, any code/text variable types should use the GetExtendedValue procedure. GetValue is the old procedure and Insight Works had to add GetExtendedValue when Microsoft changed some field lengths (if I’m not mistaken).
For variables of other types, you can use GetValueAsInt, GetValueAsDate etc. VS Code should show you all your options.
As far as the list of variables goes in the session, that is drive by the Warehouse Insight workflow for the most part. You will need to use the Inspect Context workflow interaction, along with specific Contexts to control what is displayed when inspected. If you were not using the Warehouse Insight Application Designer for your development efforts, you can print the key/value pairs of the Event Parameter Records into message/error as an alternative. The key/value pairs are very context specific and depending on the area, a variable for an item no. could include but not be limitted to “item_number” “Item No.”, or maybe “barcode.ItemNumber”.
-
AuthorPosts
- Sign in below to reply.