: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
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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):
Those lines are not tested, but I hope that should help..
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.