Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Nav 2017 - Cannot edit ship-to address to add a custom address

Posted on by 330

Nav 2017 - Cannot edit ship-to address to add a custom address or if can how can you do it.

Tried the custom address and creating a new but cannot select created new address and fields not populating

Is it how it works or bug? (we are on latest cumilative update c4)

thanks

Charith

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    @ Charith Silva

    May I know how to run the code??

  • Verified answer
    CharithSilva Profile Picture
    CharithSilva 330 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    Hello  All,

    SORTED....Published another web service to change the address after creating the order with below code

    UpdateShipAddress(InSONo : Text[30];InShipName : Text[30];InShipAddress1 : Text[30];InShipAddress2 : Text[30];InShipCity : Text[30];InShipCounty : Text[30];InShipPostcode : Text[30])

    Order.SETFILTER("No.",InSONo);

    Order.FINDFIRST;

    Order."Ship-to Code" := '';

    Order."Ship-to Name" :=InShipName;

    Order."Ship-to Address" :=InShipAddress1;

    Order."Ship-to Address 2" :=InShipAddress2;

    Order."Ship-to City" :=InShipCity;

    Order."Ship-to County" :=InShipCounty;

    Order."Ship-to Post Code" :=InShipPostcode;

    Order.MODIFY;

    Nav service restarted....And guess what SORTED.....

    THanks for the help

  • Verified answer
    CharithSilva Profile Picture
    CharithSilva 330 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    added below at the end of all methods

    ShipToOptions:=ShipToOptions::"Custom Address";

  • CharithSilva Profile Picture
    CharithSilva 330 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    I think im getting somewhere with this, now by default it opens order page with custom address, cannot try web service properly until i restart the services. i will restart tonight(because this is live im playing with) -and i will tell you the progress

    i changed page 42 as below

    OnAfterGetRecord()

    SetControlVisibility;

    UpdateShipToBillToGroupVisibility;

    ShipToOptions:=ShipToOptions::"Custom Address";

    OnNewRecord(BelowxRec : Boolean)

    "Responsibility Center" := UserMgt.GetSalesFilter;

    IF (NOT DocNoVisible) AND ("No." = '') THEN

     SetSellToCustomerFromFilter;

    SetDefaultPaymentServices;

    UpdateShipToBillToGroupVisibility;

    ShipToOptions:=ShipToOptions::"Custom Address";

    OnInsertRecord(BelowxRec : Boolean) : Boolean

    IF DocNoVisible THEN

     CheckCreditMaxBeforeInsert;

    IF ("Sell-to Customer No." = '') AND (GETFILTER("Sell-to Customer No.") <> '') THEN

     CurrPage.UPDATE(FALSE);

    ShipToOptions:=ShipToOptions::"Custom Address";

    Sell-to Customer Name - OnValidate()

    IF GETFILTER("Sell-to Customer No.") = xRec."Sell-to Customer No." THEN

     IF "Sell-to Customer No." <> xRec."Sell-to Customer No." THEN

       SETRANGE("Sell-to Customer No.");

    IF ApplicationAreaSetup.IsFoundationEnabled THEN

     SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0,Rec);

    CurrPage.UPDATE;

    ShipToOptions:=ShipToOptions::"Custom Address";

  • dkatson Profile Picture
    dkatson 2,263 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    In such case I can suggest you to create 2 additional pages just for webservice. One for sales header, another for sales line. Add all needed fields there and publish as web service.

  • Bandaru Profile Picture
    Bandaru 50 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    Hi Dmitry,

    Thanks for your reply on this.

    But as per Charith comments, the ShipToOptions field is not accessible through webservice. Thats why we are unable to assign value to it.

    If ShipToOptions field is available then it will works for us.

    Can You suggest us how to create a sales order by filling all the details like..

    1. BillTo Details

    2. ShipTo Details

    3. SellTo Details

    3. Lines

    Thanks,

    Bandaru Srinivas

  • CharithSilva Profile Picture
    CharithSilva 330 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    Hi Dimitry,

    Problem is ShiptoOptions is not available in web service. I just tried to modify page 42 on insert record and on new record with

    ShipToOptions:=ShipToOptions::"Custom Address";

    but still it says ship to address is not property editable

    is there anyway to  make ShipToOptions available via web service?

  • Suggested answer
    dkatson Profile Picture
    dkatson 2,263 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    see my suggested answer

  • dkatson Profile Picture
    dkatson 2,263 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    Hi Bandaru,

    when you fill data in SOAP web service then internal business logic of NAV is executed.

    What we have there:

    Page 42 Sales Order

    1) ShipToOptions field. This is option

    scr1.png

    So if you will fill in your web call one of this options, code above will execute. I'm not sure about Alternate Shipping adress, cos it run another page, which is not allowed in SOAP call.

    2) All fields above are editable only if ShipToOptions = "Custom Address"

    scr1.png

    So try to fill first 

    ShipToOptions = "Custom Address"

    and then "Ship-To Name" and other from the screenshot.

  • Bandaru Profile Picture
    Bandaru 50 on at
    RE: Nav 2017 - Cannot edit ship-to address to add a custom address

    Hi Dmitry Katson,

    you mean to add some CAL code on that field, to access it through webservice..?

    community.dynamics.com/.../244638

    The same question i also posted, but still now i didn't get any proper solution.

    Can you help us on it..?

    Thanks,

    Srinivas

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans