How to add Item no and description on Sales List form

Markandey_Pandey
Member Posts: 178
Hi experts
can we create a List form from tow tables, if yes then how, can anybody guide me.
Actually i want to add Item Description on Sales List form.....................
can we create a List form from tow tables, if yes then how, can anybody guide me.
Actually i want to add Item Description on Sales List form.....................
Markandey Pandey
0
Comments
-
and how do you want to do that ? there can be more than 1 line on a sales document, so there is no such things as THE item description to show there.
if you just want the first then there are several ways to accomplish that :
- Add code in the OnAfterGetRecord of the form to collect the description you want to show into a global variable, and add that var. to the form.
- Add a function to the Sales header table that does the same as the above, and add that function in a field on the form.0 -
MBerger wrote:if you just want the first then there are several ways to accomplish that :
- Add code in the OnAfterGetRecord of the form to collect the description you want to show into a global variable, and add that var. to the form.
- Add a function to the Sales header table that does the same as the above, and add that function in a field on the form.
Valid ways, but don't write code if you don't have to. A simple flowfield will do the trick...that is if you do really just want the first description.0 -
If really needed and on SQL Server you can create a (join) view on SQL Server and create a NAV form based on that view.
I've done that in the past. With some knowledge of SQL Server views and how to create a NAV form for that, it's not that difficult.
But I also would ask: why would you want that?0 -
lvanvugt wrote:If really needed and on SQL Server you can create a (join) view on SQL Server and create a NAV form based on that view.
I've done that in the past. With some knowledge of SQL Server views and how to create a NAV form for that, it's not that difficult.
But I also would ask: why would you want that?
That i can do but i am using the Native Database.Markandey Pandey0 -
MBerger wrote:and how do you want to do that ? there can be more than 1 line on a sales document, so there is no such things as THE item description to show there.
if you just want the first then there are several ways to accomplish that :
- Add code in the OnAfterGetRecord of the form to collect the description you want to show into a global variable, and add that var. to the form.
- Add a function to the Sales header table that does the same as the above, and add that function in a field on the form.
As i am new to navision can u pls give me the code for both schenario.Markandey Pandey0 -
As expert said, do not try to go typical just take a rec var for item and show description to help it like
Recitem.get("sales line".no);
and write in text box recitem.description.
i think it would be helpful to u.0 -
vijay_g wrote:As expert said, do not try to go typical just take a rec var for item and show description to help it like
Recitem.get("sales line".no);
and write in text box recitem.description.
i think it would be helpful to u.
hi thanx for the reply, i got the point but if i am doing so i am getting an error "Item No. does not exist"
can u plz tell me the reasonMarkandey Pandey0 -
vijay_g wrote:As expert said, do not try to go typical just take a rec var for item and show description to help it like
Recitem.get("sales line".no);
and write in text box recitem.description.
i think it would be helpful to u.
Hi i have declared to global rec variables and one text variable
ItemRec-> Item
SalesLine->Sale Line
Description->Text
and have written the following code:
Item.GET("Sales Line"."No.");
Description:=SalesLine.Description;
here i have assigned description as source expr to text box but its giving an error when i am running the form.
i have also tried this Textbox->source expr-> ItemRec.Description
plz suggest me the solnMarkandey Pandey0 -
lvanvugt wrote:If really needed and on SQL Server you can create a (join) view on SQL Server and create a NAV form based on that view.
I've done that in the past. With some knowledge of SQL Server views and how to create a NAV form for that, it's not that difficult.
But I also would ask: why would you want that?
Hi lvanvugt,
Kindly explain how to create Nav Form based on View created in Sql Server.0 -
Hi experts,
Actually according to our client requirement i want to add Item No and Description on the sales list form. plz note that there will be only one item per Sales order.
here i have created two fields "Item No." and "Item Description" on Sales Header table and had written the following code in OnPush trigger on Release Menu Item:
SalesHeader.RESET;
SalesHeader.SETRANGE("No.",SalesLine."Document No.");
SalesHeader.SETRANGE(SalesHeader."No.","No.");
SalesHeader."Item No.":=SalesLine."No."; // I had also tried putting constant here
SalesHeader."Item Description":=SalesLine.Description;
SalesHeader.MODIFY;
Am i going on right track, can anybody suggest me the proper solution as i have been frusted doing this from last one week.Markandey Pandey0 -
1) I will not comment the "why" for that and the "what if you have more lines"... ;-)
2) You can use GET on the header, you know exactly the primary key, do not use SETRANGE/SETFILTER and FIND when you knwo primary keys values.
3) Look at this your code:alesHeader.RESET; SalesHeader.SETRANGE("No.",SalesLine."Document No."); SalesHeader.SETRANGE(SalesHeader."No.","No."); SalesHeader."Item No.":=SalesLine."No."; // I had also tried putting constant here SalesHeader."Item Description":=SalesLine.Description; SalesHeader.MODIFY;
You are setting two filters on same field of SalesHeader... ;-) What is Rec in this code? If I "clean" this code, it looks like:alesHeader.RESET; SalesHeader.SETRANGE("No.",SalesLine."Document No."); SalesHeader.SETRANGE("No.","No."); SalesHeader."Item No.":=SalesLine."No."; // I had also tried putting constant here SalesHeader."Item Description":=SalesLine.Description; SalesHeader.MODIFY;
Can you see the problem? ;-)
And there is one thing - you are filtering and then modifying, what about reading the record first before you modify it? (GET) :whistle:0 -
See my blog post I just created: http://dynamicsuser.net/blogs/vanvugt/archive/2009/12/03/using-sql-views-in-nav.aspx.
Hope it makes sense. :P0 -
Actually what i want it to update item no and description from line to header becoz i have to add these to fields on Sales List form.
can u plz help me.Markandey Pandey0 -
And have you read my post? What is still unclear for you?0
-
[Merged topic http://www.mibuso.com/forum/viewtopic.php?f=23&t=38660 into this topic.]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
hi all
thanx for ur valuable support, issue is resolved.Markandey Pandey0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions