error" the expression code cannot be type converted to integer value" why

I make report in this report i need to make report to quantity this report design is

Customer

(inden)Sales Line

i want to add “concrete No” from table of “reservation schedule” i write this codein after get record trigger of Sales line table

IF cust.GET(“Sell-to Customer No.”)THEN
desc:=cust.“Concrete No.”;

but it give me this error" the expression code cannot be type converted to integer value"

i defined two variable in global c/al

desc code 10

cust record reservation scheduale

then i put desc text box i report but it give me error as above

Use

IF cust.GET(“Sell-to Customer No.”)THEN

desc:=FORMAT(cust.“Concrete No.”);

I try then It give me same error

Is Concrete No. in Customer table an Integer?

then define desc also as Integer datatype…

Did you double-check that desc is variable with the type ‘Text’?

concrete no found only on reservation schedule with data type code

and customer no is code data type and desc variable is code data type

Hi,

That doesn’t make allot of sense. A possible thing could be is that there’s another variable with the same name but a different datatype. E.g. It’s possible that ‘desc’ is a global variable of type ‘Code’ but in the function that you’re writing your code you’ve got a local variable of type integer.

what is the primary key of reservation scheduale table?

where is the cursor pointing after error?

Line No is primary key of reservation scheduled

the cursor give error after this line

(cursor)IF cust.GET(“Sell-to Customer No.”)THEN
desc22:= cust.“Concrete No.” ;

Then how can you get reservation scheduale record with sales Line “Sell-to Customer No.”?

Please read help regarding GET function.

What is the relation between sales Line and reservation scheduale tables?

The link between two table is “sell to customer no”

IF Line no is your primary key then you can not use GET function.

You need to use Setfiliter/setrange

So you will have only one record per sell to customer no or multiple records also in reservation scheduale table?

Can you tell me how i write this code

please help me.

http://msdn.microsoft.com/en-us/library/dd355053.aspx

Cust.SetRange(Cust.“Sell to Customer No”,“Sell to Customer No”);

IF CUST.Find(’-’) THEN

desc22:= cust.“Concrete No.” ;

OK i thanks to reply but when i write this code it no error show and display concrete no field but repeated to all records why

actually found in two record but it show in all records in report

Use

desc22:=’’;

in the begining…

What you mean about

desc22:=’’; i begining

desc22:=’’;

Cust.SetRange(Cust.“Sell to Customer No”,“Sell to Customer No”);

IF CUST.Find(’-’) THEN

desc22:= cust.“Concrete No.” ;