Announcements
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
Thanks Andre, Its working fine. Enjoy your vacations.
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.
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
Hi Uday,
After Updating customer address, it should be shown on the report of new invoice that get posted.
Thanks and regards
Siddhant Singh
Hi,
Where do you want to see the updated customer delivery address?
Uday
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
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
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
Hi
Try this,
custTable = CustTable::find(tmpPSAProjInvoiceHeader.CustAccountNum);
tmpPSAProjInvoiceHeader.CustAddress = Dirparty::GetpostalAddressbytype(custTable.party, LogisticsLocationRoleType::Delivery);
Uday
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
André Arnaud de Cal...
294,217
Super User 2025 Season 1
Martin Dráb
232,978
Most Valuable Professional
nmaenpaa
101,158
Moderator