How do i make sure LocationId is auto generated all the time. Because If i'm doing the import via DMF, there is an "auto generate" flag to acheive this. But how to do it by x++?
DirPartyLocationPostalAddressV2Entity partyPostalAddressEntity;
partyPostalAddressEntity.PartyNumber = _partyNumber;
partyPostalAddressEntity.Street = _req.Street();
partyPostalAddressEntity.City = _req.City();
partyPostalAddressEntity.County = _req.County();
partyPostalAddressEntity.State = _req.State();
partyPostalAddressEntity.CountryRegionId = _req.CountryRegionId();
partyPostalAddressEntity.ZipCode = _req.PostCode();
partyPostalAddressEntity.Roles = "Delivery"
partyPostalAddressEntity.Description = _req.LocationName();
partyPostalAddressEntity.insert();
it's because if i provide values that exactly matches another address but the locationName is different, then remmitance method of the entity gets called and it returns the old address instead of inserting a new one. How can I make sure the address is always inserted?