Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Creating a new Party record (for the purpose of creating a new Prospect) via X++

$
0
0

I'm trying to toy around with importing data via csv with X++ and creating brand new prospects.  So I'm trying to figure out the different problems first.  

The first thing I'm trying to do is create a DirParty entry with the org name, address, and contact info.  So right now I just have code trying to create this entry so I can get a partyId to then insert when I go to put a new entry into the smmBusRelTable.  I am getting this error message though saying Field 'Name' is required and I am not seeing these entries in the global address book or in the tables themselves.  I get this error 2x.

 smmBusRelTable prospect;
    DirParty dirParty;
    DirPartyPostalAddressView dirPartyPostalAddressView;
    DirPartyContactInfoView dirPartyContactInfoView;

    ttsBegin;
    prospect.initValue();

    dirParty = dirParty::constructFromCommon(prospect);
    dirParty.parmName("Test");
    dirParty.parmNameAlias("Test");
    info(dirParty.parmName());
    dirPartyPostalAddressView.LocationName = "Test";
    dirPartyPostalAddressView.Address = "Test Address";
    dirPartyPostalAddressView.County = "Test";
    dirPartyPostalAddressView.State = "IL";
    dirPartyPostalAddressView.ZipCode = "60115";
    dirPartyPostalAddressView.CountryRegionId = "US";



    dirparty.createOrUpdatePostalAddress(dirPartyPostalAddressView);


    dirPartyContactInfoView.LocationName = "Phone";
    dirPartyContactInfoView.Type = LogisticsElectronicAddressMethodType::Phone;
    dirPartyContactInfoView.Locator = "2222222222";

    dirParty.createOrUpdateContactInfo(dirPartyContactInfoView);
    info(strFmt("%1",dirParty.parmPartyNumber()));
    ttsCommit;



Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>