Hi Guys,
I updated a Sales Header - Field as Zero when Im deleting the sales line. I have written a code in Sales Line OnDelete Trigger for updating header amount.
Now, Line is deleted. But, Header amount is not cleared from form. But, Its shown zero when Im reopen the form. ie expected results.
Do you know any method for redisplaying the header field immediately when im deleting the line?
Thanks and Regards,
Rajini
0
Comments
If you want to show that total directly, you should move it to the subform.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Yes...
I have written this code in Sales Line Table OnDelete Trigger:
OnDelete()
=========
IF NVSalInvAmountChange.GET(SalesHeader."Document Type",SalesHeader."No.",'F') THEN
BEGIN
IF xRec."Line No." = NVSalInvAmountChange."Line No." THEN
BEGIN
SalesHeader."Freight Amount":=0;
SalesHeader.MODIFY;
NVDelete:=TRUE;
END;
END;
Now, SalesHeader Freight amount is updated in SQL. But, Still Sales Header Form level - Freight amount is showing old amount instead of "Zero"
It should be redisplayed immediately when this trigger fired(Code executed).
How can I refresh this value in form Header level?
Thanks,
You just put the code on OnTimer Trigger Like "Currform.update".It will be update automatically after a particular time.Just try It.
IBIZ Consulting Services,India
I think this is the answer - viewtopic.php?f=23&t=22564
be smart before being a clever.
I written code in OnTimer Trigger for updating current form. But. I didn't see any progress on the header level amount amount unfortunately. Do we need to set any property on form level?
Thanks,
And if you are filling up some long field, it is possible the timer triggers the UPDATE and you loose all changes.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!