how do i pass a variable to a dataitem from another dataitem without hard coding for it as a filter?
preferably in the predataitem,am trying to setrange but not working
If you are running this report by code(not directly from departmenu) then make a function in report set this variable value in that function and call the function before calling report.
If you are running this report by code(not directly from departmenu) then make a function in report set this variable value in that function and call the function before calling report.
but he said he's trying to pass a filter from one dataitem to another (in the same report).
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
I think you're missing the basic information to develop a report: isn't there a senior developer to train you?
I'm saying this because you've not even given us the information to help you.
-What are the dataitems?
-in what triggers did you place the code?
-can't you use the dataitemlink property?
-are the dataitems indented correctly?
with the two lines of code you've written, i cannot guess the solution (i've one in my mind, but i don't have time to shoot in the dark )
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
you belias,u now going out of proportion, even if i give you the data items,they r customs dataitems,so how will they help u?
two i have put that code on the predataitem.
three the dataitemlink property is not relevant here cant work and also the identing wont work,the two data items are running indepedently for reasons.
i just need to assingn the value job number to my variable gjobno and am good to go,the value job number is key in the data item.
I'm not sure to know what does this mean...anyway...
i want to know what are the dataitems, because i don't know if "labour header" is a variable or a dataitem
i want to know where did you place the code because...well...you've written it in the wrong place
evaluate the variable in the onaftergetrecord of the labour header, and then do setrange/setfilter in the other dataitem, or you probably can use copyfilter function, depending on your businness process
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
karuchua, we want to try to help you, but it's a bit hard to know exactly what you want to do.
Could you be more clear about what you are trying to do, what have you tried, and what was the error ?
To be frank, assigning a value to a variable should be a very easy thing to do, and you should be able to do it easily if you already know the basic. That's why we really need to clarify what you are trying to do.
And by having your code and data items, we could have a better understanding about it, and why it doesn't work.
Microsoft Certified IT Professional for Microsoft Dynamics NAV
// IF LPRqHeader."Job Number"='IN13924' THEN BEGIN
// LPRqHeader.SETFILTER(LPRqHeader."Worksheet Ref No.",LlabourHeader."Worksheet Ref No.");
LPRqLine.RESET;
LPRqLine.SETCURRENTKEY("Requisition Type","Document No.");
LPRqLine.SETRANGE(LPRqLine."Requisition Type", "Requisition Type"::Issue);
LPRqLine.SETRANGE(LPRqLine."Document No.",LPRqHeader."No.");
IF LPRqLine.FINDFIRST THEN BEGIN
GQtyIssued:=LPRqLine."Qty. Issued";
GItemDesc:=LPRqLine.Description ;
END;
//END;
FAPDPDEC09
GLHeader."Job No."
// GRQLine.RESET;
// GRQLine.SETCURRENTKEY("Requisition Type","Document No.");
// GRQLine.SETRANGE(GRQLine."Requisition Type", "Requisition Type"::Issue);
// GRQLine.SETRANGE(GRQLine."Document No.",GRQHeader."No.");
// IF GRQLine.FINDFIRST THEN BEGIN
{
IF (GRQHeader."Job Number"=GLHeader."Job No.") AND (GRQHeader."Worksheet Ref No."=GLHeader."Worksheet Ref No.")
THEN BEGIN
IF (GRQLine."Document No."=GDocNo) THEN BEGIN
IF GRQLine.FINDFIRST THEN
GItemDesc:=GRQLine.Description ;
GQtyIssued:=GRQLine."Qty. Issued";
END;
END;
}
glheader is not your dataitem (i didn't import your object, but i've not seen the dataitem name).
instead, you should do this, i think:
GJobNo:="Job No.";
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
karuchua, are you a partner or an end user ? is there any senior to help you or train you ? we could see here that you do need the basic training or you need to spend some time to read the technical documentation first. you're not supposed to jump to development before you have the basic knowledge (variable, data item, GET, etc).
Microsoft Certified IT Professional for Microsoft Dynamics NAV
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
in the case below.
SETRANGE("Job No.","Job No.")
i want to pass the "job no." to "GJobNo " as the variable but when i do like this
GJobNo:="Labour Header"."Job No.", ...................it doesn't assign,what am i misssing?
I'm saying this because you've not even given us the information to help you.
-What are the dataitems?
-in what triggers did you place the code?
-can't you use the dataitemlink property?
-are the dataitems indented correctly?
with the two lines of code you've written, i cannot guess the solution (i've one in my mind, but i don't have time to shoot in the dark )
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
two i have put that code on the predataitem.
three the dataitemlink property is not relevant here cant work and also the identing wont work,the two data items are running indepedently for reasons.
i just need to assingn the value job number to my variable gjobno and am good to go,the value job number is key in the data item.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
i want to know what are the dataitems, because i don't know if "labour header" is a variable or a dataitem
i want to know where did you place the code because...well...you've written it in the wrong place
evaluate the variable in the onaftergetrecord of the labour header, and then do setrange/setfilter in the other dataitem, or you probably can use copyfilter function, depending on your businness process
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Could you be more clear about what you are trying to do, what have you tried, and what was the error ?
To be frank, assigning a value to a variable should be a very easy thing to do, and you should be able to do it easily if you already know the basic. That's why we really need to clarify what you are trying to do.
And by having your code and data items, we could have a better understanding about it, and why it doesn't work.
Just a happy frood who knows where his towel is
where is your code which you mentioned in first post?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
instead, you should do this, i think:
GJobNo:="Job No.";
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
1.labour header
2.posted gen req. header
3.posted gen req.line
@mohana_cse06,the use of tht setrange is to filter the records by job number.
i havent written code to get the glheader,when i try writing,am getting an error that my data item doesn.t exist
remove the code..
can you show us the code which is returning error?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
the code is below,its on the aftergetrecord.
GLHeader.GET(GLHeader."Job No.");
GJobNo:="Job No.";
if Partner, please read the basic technical documents..
if end-user, contact partner.. :thumbsup:
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Just a happy frood who knows where his towel is