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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Vendor Import-

(0) ShareShare
ReportReport
Posted on by 6

DIRPARTY.JPG

public DirPartyPostalAddressView createOrUpdatePostalAddress in this method.. It is returning null value.. Instead of newPartyPostalAddressView.

private void InsertVendorMaster(VendorImportStagingTable _vendorstagingtable)
{
container roles;
DirPartyPostalAddressView addressview;
LogisticsPostalAddress address;
DirPartyRecId partyrecid;


ttsBegin;
dirOrganization.clear();
dirOrganization.initValue();
dirOrganization.Name = _vendorstagingtable.Name;

if (dirOrganization.validateWrite())
{

dirOrganization.insert();

if (dirOrganization)
{
vendTable.clear();
vendTable.initValue();
vendTable.AccountNum = _vendorstagingtable.AccountNum;

vendTable.VendGroup = _vendorstagingtable.VendGroup;
vendTable.initFromVendGroup(VendGroup::find(_vendorstagingtable.VendGroup));
vendTable.PaymId = _vendorstagingtable.PaymTermId;
vendTable.PaymMode = _vendorstagingtable.VendPaymMode;
vendTable.Currency = _vendorstagingtable.Currency;
vendTable.DefaultDimension = MasterImport::setFinancialDimensionToVendor(_vendorstagingtable);
partyRecId = DirPartyTable::createNew( DirPartyType::Organization, dirOrganization.Name).RecId;
vendTable.Party = partyRecId;
if (vendTable.validateWrite())
{
vendTable.insert();
}

dirParty = DirParty::constructFromCommon(vendtable);
address.City = _vendorstagingtable.City;
address.County = _vendorstagingtable.County;
address.CountryRegionId = _vendorstagingtable.CountryRegionId;
address.Street = _vendorstagingtable.Street;
address.State = _vendorstagingtable.StateId;
address.ZipCode = _vendorstagingtable.ZipCode;
address.insert();
addressview.IsPrimary = _vendorstagingtable.AddressIsPrimary;
addressview.LocationName = "HeadQuaters";
addressView.Party = vendTable.Party;
addressview.initFromPostalAddress(address);
roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId];
dirparty = DirParty::constructFromPartyRecId(addressView.Party);
dirParty.createOrUpdatePostalAddress(addressview, roles);


}
}
ttsCommit;

}

*This post is locked for comments

I have the same question (0)
  • Vilmos Kintera Profile Picture
    46,149 on at

    Please provide better description about your issue, like what are you trying to do business process-wise, and explain why would you expect a value where you do not get one, rather than copypasting code. Also is this something standard, or customized. If customized, then what is changed?

    Also select the Use rich formatting editor below the text box, and paste your formatted code with the </> Insert code tag, so it will look more readable, otherwise people will not bother paying attention to your topic..

  • NoobDaxCoder Profile Picture
    6 on at

    kjl.jpg

    _partyPostalAddressView value is null. Eventhough i have inserted values into that view. I am not sure what i am doing wrong. Please help.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Check your input parameters, and the code you are calling, if they are valid and is not throwing an error inside.

    In the variable list in the debugger I am seeing 0 RecId for your method parameter view, which means there is no inserted record there, your view is empty. Now if the called method would do a validation or a search based on the RecId != 0, then that obviously would fail.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans