how can I put Variant Picture of the Item....
ali_khodr
Member Posts: 4
:oops:
Hello Developers and Consultants.
I am designing report for Sales Order.
However it requires to put Picture of Item in Sales Line.
This is simple.
But the difficulty is how can I put Variant Picture of the Item if there is already any one.
I mean that I want to display picture of Item in case no Variant Picture.
Otherwise , I want to show the Variant Picture.
I tried all ways , I am beginner in Reporting.
and please explain to me how I use Grouping or Filtering to solve my problem.
Or is there any simple way ? !
Thanks in advance, hopefully that I find a smart consultant or developer who answered me.
Good Luck
Hello Developers and Consultants.
I am designing report for Sales Order.
However it requires to put Picture of Item in Sales Line.
This is simple.
But the difficulty is how can I put Variant Picture of the Item if there is already any one.
I mean that I want to display picture of Item in case no Variant Picture.
Otherwise , I want to show the Variant Picture.
I tried all ways , I am beginner in Reporting.
and please explain to me how I use Grouping or Filtering to solve my problem.
Or is there any simple way ? !
Thanks in advance, hopefully that I find a smart consultant or developer who answered me.
Good Luck
0
Comments
-
[Topic moved from 'General Chat' forum to 'NAV/Navision Classic Client' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi,
if I understood well your problem, you want to:
a. IF Variant Item Picture is available -> use it
b. IF Variant Item Picture is not available -> use Item Picture.
Is it correct? If so, I think you should add some code like the following in the OnAfterGetRecord trigger of the Sales Line (that is supposed to be called SalesLine):lVariantItemHASVALUE := FALSE; // Boolean local var IF SalesLine.Type = SalesLine.Type::Item THEN BEGIN // lRecItem = Record Item local var IF lRecItem.get(SalesLine."Variant Code") THEN // Try to get the Variant Item BEGIN lRecItem.CALCFIELDS(Picture); lVariantItemHASVALUE := lRecItem.Picture.HASVALUE; // Check if a picture of the Variant Item is available END; IF NOT lVariantItemHASVALUE THEN // No Variant Item or no Picture for that is available BEGIN lRecItem.get(SalesLine."No."); // Use the Item Picture lRecItem.CALCFIELDS(Picture); END; END;
Those lines are not tested, but I hope that should help..-- Jup --0 -
Hi,
if I understood well your requirment is like:
a. IF Variant Item Picture is available -> use it
b. IF Variant Item Picture is not available -> use Item Picture.
If it is correct then i think you should add some code like the following in the 'OnAfterGetRecord' trigger of the Sales Line Form.
As per my knowledge there is no picture facility available for Item variant, so first you need to add a new field called 'Picture' in Item Variant Table.
VariantPicture:=FALSE;//Variable as a boolen type
IF Type=Type::Item THEN BEGIN
ItemVariant.RESET;//ItemVariant is record variable for Item variant Table
ItemVariant.SETRANGE(ItemVariant."Item No.","No.");
ItemVariant.SETRANGE(ItemVariant.Code,"Variant Code");
IF ItemVariant.FINDFIRST THEN BEGIN
ItemVariant.CALCFIELDS(ItemVariant.Picture);
IF ItemVariant.Picture.HASVALUE THEN BEGIN
VariantPicture:=TRUE;
Picture:=ItemVariant.Picture;
END;
END;
IF VariantPicture=FALSE THEN BEGIN
IF Item_Local.GET("No.") THEN;//Item_Local is record variable for Item table
Item_Local.CALCFIELDS(Item_Local.Picture);
Picture:=Item_Local.Picture;
END;
END;
Also if you want item or item variant picture at time of insertion , please add sane code on 'OnAfterValidate' trigger for No. and Variant code in sales line form.
Please try above and if you have any quarry please let me know.0
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
- 322 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