Options

Display issue in Header Window

rajinivmrajinivm Member Posts: 42
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

Comments

  • Options
    kapamaroukapamarou Member Posts: 1,152
    CurrForm.UPDATE ?
  • Options
    rajinivmrajinivm Member Posts: 42
    No, Im writing code in OnDelete (Database Trigger) this time. Hope, I will not able to use currForm.update here. Please correct me if im wrong.
  • Options
    kapamaroukapamarou Member Posts: 1,152
    Does the code execute when you delete a line from the Sales Order Line subform?
  • Options
    krikikriki Member, Moderator Posts: 9,090
    If you are on the line and change a field in the header record, the main form is not updated by an action on a subform record. Once you click on the main form, the record will be updated and the new value will be shown.
    If you want to show that total directly, you should move it to the subform.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    rajinivmrajinivm Member Posts: 42
    Hi kapamarou ,
    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,
  • Options
    devu_13devu_13 Member Posts: 101
    Hi
    You just put the code on OnTimer Trigger Like "Currform.update".It will be update automatically after a particular time.Just try It.
    Devendra Kr. Sharma
    IBIZ Consulting Services,India
  • Options
    sendohsendoh Member Posts: 207
    hi rajinivm,

    I think this is the answer - viewtopic.php?f=23&t=22564

    :D
    Sendoh
    be smart before being a clever.
  • Options
    rajinivmrajinivm Member Posts: 42
    Hi All,

    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,
  • Options
    krikikriki Member, Moderator Posts: 9,090
    rajinivm wrote:
    Hi All,

    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,
    Yes, you need to set the TimerInterval-property. But I wouldn't advice to do that. putting a Currform.UPDATE on the header ALSO updates the subform!
    And if you are filling up some long field, it is possible the timer triggers the UPDATE and you loose all changes.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.