Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Customer Delivery Postal Address

(0) ShareShare
ReportReport
Posted on by 518

Hi All,

I have updated the delivery postal address of a customer and now i am printing in Invoice from Project management >  Project Invoice.

But after updating the customer delivery address also, its not reflecting the updated address. Its reflecting the old address only. 

Can anyone help how can we reflect the updated customer address.

Thanks and regards 

Siddhant Singh

  • Siddhant Singh Profile Picture
    518 on at
    RE: Customer Delivery Postal Address

    Thanks Andre, Its working fine. Enjoy your vacations.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    294,217 Super User 2025 Season 1 on at
    RE: Customer Delivery Postal Address

    Hi Siddhant,

    I think it comes from the Funding source. Path: Project contract > Funding source > Details. When you update a customer address, this funding source address is not updated automatically.

    If changing this address is not working for new invoice proposals, you can review during the invoice process where the address is taken from with help of the debugger. I don't have an environment available as I'm enjoying a vacation. You can review if the address is picked during the proposal process or when posting the project invoice. When the address is retrieved, you can review the logic where the address is defaulted from.

  • Suggested answer
    udaY-ch Profile Picture
    4,643 on at
    RE: Customer Delivery Postal Address

    Hi Sid

    Guessing the customer address is updated. You need to create event handler to insert the address into CustAddress from customer address of type delivery.

    Class PSAProjInvoiceHeaderTmpEventHandler    
    {        
        [DataEventHandlerAttribute(tableStr(PSAProjInvoiceHeaderTmp), DataEventType::Inserting)]        
        public static void PSAProjInvoiceHeaderTmpInsertEvent(Common c, DataEventArgs e)        
        {           
            PSAProjInvoiceHeaderTmp tempTable = c;              
            CustTable custTable = CustTable::find(tempTable.CustAccountNum);              
            tempTable.CustAddress = Dirparty::GetpostalAddressbytype(custTable.party, LogisticsLocationRoleType::Delivery);        
        }    
    }

    Uday

  • Siddhant Singh Profile Picture
    518 on at
    RE: Customer Delivery Postal Address

    Hi Uday,

    After Updating customer address, it should be shown on the report of new invoice that get posted.

    Thanks and regards

    Siddhant Singh

  • udaY-ch Profile Picture
    4,643 on at
    RE: Customer Delivery Postal Address

    Hi,

    Where do you want to see the updated customer delivery address?

    Uday

  • Siddhant Singh Profile Picture
    518 on at
    RE: Customer Delivery Postal Address

    Hi Uday,

    Even the new invoices also not showing the updated Address.

    Below code show, its selecting firstonly.

    public static LogisticsPostalAddress findRecId(
        RecId   _recId,
        boolean _update = false,
        utcdatetime _validFrom = DateTimeUtil::minValue(),
        utcdatetime _validTo = DateTimeUtil::maxValue())
    {
        LogisticsPostalAddress logisticsAddress;
    
        if (_recId)
        {
            logisticsAddress.selectForUpdate(_update);
    
            select firstonly validtimestate(_validFrom, _validTo) logisticsAddress
                where logisticsAddress.RecId == _recId;
        }
        return logisticsAddress;
    }

    Can we get address using primary address.

    Thanks and resgards

    Siddhant Singh

  • udaY-ch Profile Picture
    4,643 on at
    RE: Customer Delivery Postal Address

    Hi Sid

    As said before, standard report derives CustAddress from ProjInvoiceJour table. The table will have the old reference

    of the Delivery postal address. For upcoming project invoices, new delivery address will be used automatically when creating the project invoice.

    "This customization is required to show the new delivery postal address for the old project invoices which will have old delivery address." If the business is okay to see the new delivery postal address for the upcoming project invoices then fine we don't need this customization at all.

    This customization will also help in case of the delivery address change in the future. (Only for project invoice report)

    Uday

  • Siddhant Singh Profile Picture
    518 on at
    RE: Customer Delivery Postal Address

    HI Uday,

    Do we really need to customize this. As there must me functionality in which new address gets updated when we do any change.

    Thanks and regards

    Siddhant Singh

  • udaY-ch Profile Picture
    4,643 on at
    RE: Customer Delivery Postal Address

    Hi

    Try this,

    custTable = CustTable::find(tmpPSAProjInvoiceHeader.CustAccountNum);

    tmpPSAProjInvoiceHeader.CustAddress = Dirparty::GetpostalAddressbytype(custTable.party, LogisticsLocationRoleType::Delivery);

    Uday

  • Siddhant Singh Profile Picture
    518 on at
    RE: Customer Delivery Postal Address

    Hi Andre,

    I have inserted a new record in LogisticsPostalAddress from Cusromer > Address > Delivery address.

    But when i am going to post the new invoice. The new inserted address is not picked up. Also i have set the address to primary.

    Below is the code to fetch the customer address in report.

    tmpPSAProjInvoiceHeader.CustAddress = LogisticsPostalAddress::findRecId(projInvoiceJour.DeliveryPostalAddress).Address;

    My requirement is that it should pick up the new inserted address. How can i achieve it.

    Thanks and regards

    Siddhant Singh

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,217 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,978 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans