Hello all,
I have a card-form which is based on Header and Line.
On Sales Line form, I have kept a field Status which has the option values: Partly and Closed.
Also, I have this field on the Header part too.
For a particular Order No., I have several lines with Status Partly and Closed.
On the Sales Order form, if I validate the all Status on the Line to be Closed, then the Status of the Header part should be Closed.
For e.g: Sales Line part
1) Document No.: S0001
Line 1:
Item A - Status: Partly
Line 2:
Item B- Status: Closed
Status on Header: Partly
2) Document No.: S0002
Line 1:
Item A - Status: Closed
Line 2:
Item B- Status: Closed
Status on Header: Closed
Can somebody please give some help. I am stuck on it.
Thanks
Liizz
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
There is no code on this field on table 36.
Thanks
Liizz
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thanks Mohana.
But the field Status is not getting updated on the Header part. I am trying the example you told me.
This is the piece of code which is updating the Status for each Lines for that particular Document No.
RecLine.SETRANGE("Document No.","Document No.");
RecLine.SETFILTER("Qty Del",'>%1',0);
IF RecLine.FINDSET THEN
REPEAT
IF (RecLine."Qty Del"<>RecLine.Quantity) THEN BEGIN
RecLine.Status:=RecLine.Status::"Partly";
RecLine.MODIFY;
EXIT;
END ELSE IF (RecLine."Qty Del"=RecLine.Quantity) THEN BEGIN
RecLine.Status:=RecLine.Status::Closed;
RecLine.MODIFY;
END;
UNTIL RecLine.NEXT=0;
RecLine: record variable.
If all the Status from the Lines are closed, then Status on Header =Closed
else Status on Header=Partly
Please help me.. ](*,)
Thanks
Liizz
why are you reinventing the wheel?
Do you see:
Sales Header: Completely Shipped (5752) Type Boolean
Flowfield
Min("Sales Line"."Completely Shipped" WHERE (Document Type=FIELD(Document Type),Document No.=FIELD(No.),Shipment Date=FIELD(Date Filter),Location Code=FIELD(Location Filter)))
Sales Line: Completely Shipped (5752) Type Boolean
It's value is calc'ed on Quantity - OnValidate()
if "Qty Del" is your custom field.
If you want to copy that functionality to a new fields called "Completely Delivered" then follow how "Completely Shipped" Works and you'll probably have to calc the value on your "Qty Del" - OnValidate.
You'll see you don;t need all that code. and what trigger is all that code on anyway?
http://www.BiloBeauty.com
http://www.autismspeaks.org
I have placed these codes on a Submit button, each lines is getting updated.
But, on the Sales Line there is no codes on the Quantity-OnValidate() where CALCFIELDS is being used.
Yes, I have also defined a Boolean field as u mentioned.
Min("Custom Lines"."Completely Delivered" WHERE (Document No.=FIELD(No.),Status=FIELD(Status)))
But still, its not working. The Status is not being changed accordingly
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
But where should I use the CALCFIELDS functionality?
Thanks
Liizz
if in report then need to use CALCFIELDS..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Please can u be a bit more clear in what u mean.
Thanks
Liizz
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav