Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Extending LogisticsPostalAddress form

(1) ShareShare
ReportReport
Posted on by 191
I want to add the following functionality:
 
When I am looking at the detailpage of a customer and I click on 'add address' a sidepanel opens to insert the address.
 
This sidepanel contains the 'LogisticsPostalAddress' form. I want to simply, on the opening of the form, copy the customers' name into the name field of the new address.
 
For this I tried to extend the init, run and initializeViewOpenMode functions, but to non avail.
 
Example:
public void init()
    {
        next init();
        CustTable custTable;
        select custTable where custTable.AccountNum == this.custAccount;
        Details_Description.Text(custTable.name());
    }
 
I can see in a breakpoint that custTable.name() returns the correct value, but the field stays empty in each extension. 
I do notice that all the functions are called before I can visually see the form, so maybe that is the problem?
 
Could someone advice how to correctly implement this functionality?
  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    Extending LogisticsPostalAddress form
    Hi, there is custAccount parm method and custAccount variable in LogisticsPostalAddress form. You can try using custAccount variable. You can either use OnInitValue event handler for InventLocation datasource or create extension class of form datasource.
     
    LogisticsLocation.Description = custAccount;
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    Extending LogisticsPostalAddress form
    Details_Description control is bound to a data source field, therefore you should assign the value there: logisticsLocation.Description = custTable.name().
     
    It's too early to do it in init() - initValue() method of LogisticsLocation data source is likely the right one.
     
    Also, it's wrong to assume that every address is related to a customer.
  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    Extending LogisticsPostalAddress form
    Moved from D365 general forum to the Finance forum, because its seems to be about F&O and not about D365 in general. Please let me know if you disagree.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans