field update in RTC page

Amolkbhad23Amolkbhad23 Member Posts: 46
edited 2012-08-27 in NAV Three Tier
Hi all,
In navision i modify code unit 64 Sales-Get Shipment. As my sales Invoice is also upadate with location code , exteernal document no and dimension 1 and 2.
this code is working properly in classic but when i go thorugh RTC page at that time is also working.
but issue is that every time i have to close that page i.e. sales Invoice Page or i have to refresh.
do any one know how can i solve this issue ?
:-k [-o<

Comments

  • Amolkbhad23Amolkbhad23 Member Posts: 46
    i am using NAV 2009 R2.
  • Amolkbhad23Amolkbhad23 Member Posts: 46
    Hi all,
    In navision i modify code unit 64 Sales-Get Shipment. As my code sales Invoice is also upadate with location code , exteernal document no and dimension 1 and 2.
    this code is working properly in classic but when i go thorugh RTC page at that time is also working.
    but issue is that every time i have to close that page i.e. sales Invoice Page or i have to refresh.
    do any one know how can i solve this issue ?
    :-k [-o<
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Cant you wait?

    What code did you write and are the other fields updated at first time only?
  • Amolkbhad23Amolkbhad23 Member Posts: 46
    sir, below code i write in CU 64

    CreateInvLines(VAR SalesShptLine2 : Record "Sales Shipment Line")
    // code for update invoice header ST** ZT-AB
    SalesShptHeader1.RESET;
    SalesShptHeader1.SETRANGE(SalesShptHeader1."No.",SalesShptLine2."Document No.");
    IF SalesShptHeader1.FINDFIRST THEN BEGIN
    IF SalesHeader."Location Code" = '' THEN
    SalesHeader."Location Code" := SalesShptHeader1."Location Code";
    SalesHeader.VALIDATE(SalesHeader."Location Code");
    IF SalesHeader."Shortcut Dimension 1 Code" = '' THEN BEGIN
    SalesHeader."Shortcut Dimension 1 Code" :='20';
    SalesHeader.VALIDATE(SalesHeader."Shortcut Dimension 1 Code");
    END;
    IF SalesHeader."Shortcut Dimension 2 Code" = '' THEN BEGIN
    SalesHeader."Shortcut Dimension 2 Code" :=SalesShptHeader1."Shortcut Dimension 2 Code";
    SalesHeader.VALIDATE(SalesHeader."Shortcut Dimension 2 Code");
    END;
    IF SalesHeader."External Document No." = '' THEN
    SalesHeader."External Document No." := SalesShptHeader1."External Document No." ;
    IF SalesHeader."Currency Code" = '' THEN BEGIN
    SalesHeader."Currency Code" := SalesShptHeader1."Currency Code";
    SalesHeader.VALIDATE(SalesHeader."Currency Code");
    END;
    IF SalesHeader."Payment Terms Code" = '' THEN BEGIN
    SalesHeader."Payment Terms Code" := SalesShptHeader1."Payment Terms Code";
    SalesHeader.VALIDATE(SalesHeader."Payment Method Code");
    END;

    SalesHeader.MODIFY;

    END;

    // code for update invoice header EN** ZT-AB
    WITH SalesShptLine2 DO BEGIN
    SETFILTER("Qty. Shipped Not Invoiced",'<>0');
    IF FINDSET THEN BEGIN
    SalesLine.LOCKTABLE;
    SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");
    SalesLine.SETRANGE("Document No.",SalesHeader."No.");
    SalesLine."Document Type" := SalesHeader."Document Type";




    Now when i use get shipment Line (For Sales) in Classic i.e. using Form
    it is working in Sales Invoice Header, Shortcut Dimension 1 Code, Shortcut Dimension 2 Code, location code ...etc is update as i write in code.
    but when i use same porcess in Pages. Sales Invoice Page is not Update.
    alyways i have to press F5 (Refresh). so is there any other way so that my Sales Invoice Page automatic update.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Did you check Copy Document function? this has the option to update the header also..

    so the difference is Copy Document is in Header level and Get Shipments is in Line level..

    I will have a deep look into it and update you.
  • Amolkbhad23Amolkbhad23 Member Posts: 46
    thanks my issue is resloved..
    Thanks once again
    =D>
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    thanks my issue is resloved..
    Thanks once again
    =D>
    Welcome :thumbsup:
  • mdPartnerNLmdPartnerNL Member Posts: 802
    Are there other ways to do this? The tip looks good but it seams so strange they don't have a update statement for this..
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Yes its strange, because in classic we will be calling subform function from Main form itself..but in rtc pages the action is completely shifted to Subpage..there will not be any link to main Page..
Sign In or Register to comment.