web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Update Shipping Tab in Sales Credit memo Page

(0) ShareShare
ReportReport
Posted on by 5

Hello Experts,

I have added Shipping Tab in Sales credit memo page and it includes all Shipping elated fields like Ship code, Ship to name, Address etc. Ship to information has been added in all customers  so  Customer wants to update these fields automatically when we select Sell to Customer No. when create new Sales credit memo. I have added below code however it doesn't work. 

 modify("Sell-to Customer No.")
    
        {
        trigger Onaftervalidate()
        var myInt: Integer;
        ShiptoAddres: Record "Ship-to Address";
        SH: Record "Sales Header";
        begin
                if ShiptoAddres.get("Sell-to Customer No.") then begin
                "Ship-to Code":=ShiptoAddres.Code;
                "Ship-to Name":=ShiptoAddres.Name;
                "Ship-to Address":=ShiptoAddres.Address;
                "Ship-to Address 2":=ShiptoAddres."Address 2";
                "Ship-to City":=ShiptoAddres.City;
                "Ship-to County":=ShiptoAddres.County;
                "Ship-to Country/Region Code":=ShiptoAddres."Country/Region Code";
                "Ship-to Contact":=ShiptoAddres.Contact;
            end;
        end;      

I tried the same code in page OnValdate triger as well but no luck.

Any help will be really appreciated. Thanks.

Amy.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    You need Rec.modify(); after you have set the field values.

  • Amy_ Profile Picture
    5 on at

    i did that too but didnt work unfortunately :(

  • Suggested answer
    YUN ZHU Profile Picture
    95,681 Super User 2025 Season 2 on at

    Hi, It doesn't seem to get the data.

    if ShiptoAddres.get("Sell-to Customer No.") then begin

    The key of ShitoAddress.table is "Customer No." and "Code".

    I think you can try adding Ship-to Code to the Get function.

    pastedimage1628033220492v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans