Hi all,
I am trying to find all the unique SOs' for an item that it is reserved for.
e.g Item 1234 has some stock reserved for SO1234 and SO1235 but the stock is in multiple bins and thus there are more than one reservation entry for each SO. I want to be able to place the SO number in a text field to display on a report, so the result I am looking for is "SO1234, SO1235".
I have used some code:
Variable
arrays Text 100
x Integer
y Integer
SOCollate Text 250
Res Record Reservation Entry
Code
x:=1;
y:=0;
IF Res.FIND('-') THEN
REPEAT
arrays[x] := Res."For ID";
repeat
if arrays[y] = Res."For ID" THEN
Test=TRUE;
UNTIL y=x-1 OR Test=TRUE;
IF Test = FALSE Then
SOcollate := SOcollate + ', ' + Res."For ID";
UNTIL rES.NEXT=0;
My issue is that when I try to compile, I get the error message 'Type conversion not possible because 1 of the operators contains an invalid type, Char:= Code'
Am I missing something?
Many thanks for any help.
Mike
0
Answers
The compiler is picking up that you are using a char from the string "arrays". To make it into an array you need to set the dimensions property on the variable.
You could also solve it in the report with grouping or using the currreport.showoutput on the section
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Mike
Mike
The dimension would have to be set greater than the number of orders returned - depends on data. I would advise you to use showoutput commend in the report which you can control.
e.g.
in the OnPreSection() on the section of the report add in somthing like
currreport.showoutput( oldSOcode = Res."Source Ref. No." );
oldSOcode := Res."Source Ref. No.";
This dataitem will need the sorted by Source ref. no. for this to work.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Mike