AX 2012AX 2012 R3X++

Create Customer By X++ With Address AX 2012

public void CustomerImport(Name _Name,NameAlias _NameAlias,LogisticsAddressCityName _City,LogisticsAddressCountryRegionName _Country
,DirPartyName _BusinessUnit,DirPartyName _CostCenter, CustGroupId _CustGroup
,PaymTermId _PaymTermId,inventlocationid _InventLocation,NumberSequenceGroupId _numberSequenceGroup
,LineOfBusinessId _LineOfBusinessId,InventSiteId _InventSiteId,smmSegmentId _SegmentId
,str 100 _SalesMan, str 100 _salesManager)
{

DirPerson dirPerson;
DirPersonName dirPersonName;
LogisticsLocation logisticsLocation;
LogisticsPostalAddress logisticsPostalAddress;
LogisticsElectronicAddress logisticsElectronicAddress;
CustTable custTable;
DirOrganization dirOrganization;
OMOperatingUnit OMOperatingUnitBuisnessUnit,OMOperatingUnitCostCenter;
DirPerson SalesMan,SalesManager;
InventLocation InventLocation;
InventSite InventSite;
PaymTerm PaymTerm;
LineOfBusiness LineOfBusiness;
NumberSequenceGroup NumberSequenceGroup;
CustGroup CustGroup;
smmBusRelSegmentGroup smmBusRelSegmentGroup;
DirParty dirParty;
//DirPartyPostalAddressView dirPartyPostalAddressView;
DirPartyContactInfoView dirPartyContactInfo;

try
{
ttsbegin;

// valid the input data of business unit and cost center
select OMOperatingUnitBuisnessUnit where OMOperatingUnitBuisnessUnit.Name like ‘*’+_BusinessUnit+’*’
&& OMOperatingUnitBuisnessUnit.OMOperatingUnitType==OMOperatingUnitType::OMBusinessUnit;
if (!OMOperatingUnitBuisnessUnit)
throw error(” Business Unit :”+_BusinessUnit+’ InValid ..Please check It’);
select OMOperatingUnitCostCenter where OMOperatingUnitCostCenter.Name like ‘*’+_CostCenter+’*’
&& OMOperatingUnitCostCenter.OMOperatingUnitType==OMOperatingUnitType::OMCostCenter;
if (!OMOperatingUnitCostCenter)
throw error(” Cost Center :”+_CostCenter+’ InValid ..Please check It’);
// valid the input data of salesman and salesmanager
select SalesMan where SalesMan.Name like ‘*’+_SalesMan+’*’;
if (!SalesMan)
throw error(” Sales Man :”+_SalesMan+’ InValid ..Please check It’);
select SalesManager where SalesManager.Name like ‘*’+_salesManager+’*’;
if (!SalesManager)
throw error(” Sales Manager :”+_salesManager+’ InValid ..Please check It’);
// valid the input data of warehouse and site
select InventLocation where InventLocation.InventLocationId==_InventLocation;
if (!InventLocation )
throw error(” Warehouse :”+_InventLocation+’ InValid ..Please check It’);
select InventSite where InventSite.SiteId==_InventSiteId;
if (!InventSite )
throw error(” Site Id :”+_InventSiteId+’ InValid ..Please check It’);
// valid the input data of payment of term
select PaymTerm where PaymTerm.PaymTermId==_PaymTermId;
if(!PaymTerm)
throw error(” Paym Term :”+_PaymTermId+’ InValid ..Please check It’);
// valid the input data of line of business
Select LineOfBusiness where LineOfBusiness.LineOfBusinessId==_LineOfBusinessId;
if(!LineOfBusiness)
throw error(” Line Of Business :”+_LineOfBusinessId+’ InValid ..Please check It’);
// valid the input data of number sequnece group
select NumberSequenceGroup where NumberSequenceGroup.numberSequenceGroupId==_numberSequenceGroup;
if(!NumberSequenceGroup)
throw error(” Number Sequence Group :”+_numberSequenceGroup+’ InValid ..Please check It’);
// valid the input data of custgroup
select CustGroup where CustGroup.CustGroup==_CustGroup;
if(!CustGroup)
throw error(” Cust Group :”+_CustGroup+’ InValid ..Please check It’);
// valid the input data of SegmentId
select smmBusRelSegmentGroup where smmBusRelSegmentGroup.SegmentId==_SegmentId;
if(!smmBusRelSegmentGroup)
throw error(” SegmentId :”+_SegmentId+’ InValid ..Please check It’);

//Organization
dirOrganization.clear();
dirOrganization.initValue();
dirOrganization.Name = _Name;
dirOrganization.NameAlias=_NameAlias;

if (dirOrganization.validateWrite())
{
dirOrganization.insert();

if (dirOrganization)
{

//Location
logisticsLocation = LogisticsLocation::create(_Name, NoYes::Yes);

//Party location
DirParty::addLocation(dirOrganization.RecId, logisticsLocation.RecId, true, true, false, [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId]);

//Postal address
logisticsPostalAddress.clear();
logisticsPostalAddress.initValue();
logisticsPostalAddress.City =_City;
logisticsPostalAddress.CountryRegionId = _Country;
logisticsPostalAddress.Address = LogisticsPostalAddress::formatAddress(
”,”, _City, ”, ”, _Country);
logisticsPostalAddress.Location = logisticsLocation.RecId;
logisticsPostalAddress.ValidFrom = DateTimeUtil::utcNow();
logisticsPostalAddress.ValidTo = DateTimeUtil::maxValue();

if (logisticsPostalAddress.validateWrite())
{
logisticsPostalAddress.insert();
}
else
throw error(“Postal address”);
//Customer
custTable.clear();
custTable.initValue();
custTable.AccountNum = NumberSeq::newGetNum(CustParameters::numRefCustAccount()).num();
custTable.CustGroup = CustGroup.CustGroup;
custTable.initFromCustGroup(CustGroup::find(CustGroup.CustGroup));
custTable.Currency = ‘SAR’;
custTable.PaymTermId=PaymTerm.PaymTermId;
custTable.InventLocation=InventLocation.InventLocationId;
custTable.numberSequenceGroup=NumberSequenceGroup.numberSequenceGroupId;
custTable.LineOfBusinessId=LineOfBusiness.LineOfBusinessId;
custTable.InventSiteId=InventSite.SiteId;
custTable.SegmentId=_SegmentId;
custTable.DlvMode=’default’;
custTable.WorkerSalesResponsible=HcmWorker::findByPerson( SalesMan.RecId).RecId;
custTable.WorkerSalesTaker=HcmWorker::findByPerson( SalesManager.RecId).RecId;
custTable.DefaultDimension = AxdDimensionUtil::getDimensionAttributeValueSetId(
[2, “CostCenter”, OMOperatingUnitCostCenter.OMOperatingUnitNumber, “BusinessUnit”, OMOperatingUnitBuisnessUnit.OMOperatingUnitNumber]);
custTable.Party=dirOrganization.RecId;
if (custTable.validateWrite())
{
custTable.insert();
// customer phone
dirParty = DirParty::constructFromCommon(custTable);
dirPartyContactInfo.LocationName =’Contact Phone’;
dirPartyContactInfo.Locator =’01226636683′;
dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
dirPartyContactInfo.IsPrimary = NoYes::Yes;

// Fill Contacts
dirParty.createOrUpdateContactInfo(dirPartyContactInfo);
}
else
throw error(“Customer”);

}
}
else
throw error(“Person”);

ttscommit;
}
catch
{
error(“Error!”);
return;
}

info(custTable.nameAlias()+” ..Done! “+custTable.AccountNum);
}

299 thoughts on “Create Customer By X++ With Address AX 2012

  1. Hello there! This post could not be written much better!
    Looking at this post reminds me of my previous roommate!
    He always kept preaching about this. I will send this post to him.
    Pretty sure he’ll have a very good read. Thank you for sharing!

  2. Hello There. I found your blog using msn. This is a really well written article.
    I’ll make sure to bookmark it and come back to read more
    of your useful information. Thanks for the post.
    I will definitely comeback.

  3. An interesting discussion is worth comment. I believe that you should publish more on this issue, it might
    not be a taboo subject but generally people do not
    speak about these subjects. To the next! Many thanks!!

  4. My programmer is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type
    on a variety of websites for about a year and am anxious about switching to another platform.
    I have heard great things about blogengine.net.
    Is there a way I can import all my wordpress posts into it?
    Any help would be really appreciated!

  5. I do accept as true with all the ideas you have offered in your post. They are very convincing and can certainly work. Still, the posts are very brief for newbies. Could you please lengthen them a bit from next time? Thank you for the post.

  6. I was wondering if you ever thought of changing the layout of your site?
    Its very well written; I love what youve
    got to say. But maybe you could a little more in the way of
    content so people could connect with it better. Youve got an awful lot of text for only having one or two pictures.
    Maybe you could space it out better?

  7. Thanks for every other informative web site. The place else may I am getting that kind of info written in such a perfect approach?
    I’ve a project that I’m simply now operating on, and I’ve been on the glance
    out for such information.

  8. Hello there, I do believe your site may be having
    internet browser compatibility issues. When I take a
    look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some
    overlapping issues. I just wanted to give you a quick heads up!
    Aside from that, fantastic website!

  9. Hello, i read your blog from time to time and i own a similar one and i was just
    wondering if you get a lot of spam comments? If so
    how do you prevent it, any plugin or anything you can recommend?
    I get so much lately it’s driving me mad so any
    support is very much appreciated.

  10. I don’t know if it’s just me or if perhaps everyone else experiencing problems with your
    blog. It appears as though some of the written text in your posts are running off the screen. Can someone else please comment and let me know
    if this is happening to them as well? This might be a problem with my
    internet browser because I’ve had this happen previously.
    Thank you

  11. Howdy I am so glad I found your website, I really found
    you by mistake, while I was looking on Digg for something else, Anyhow I am here now and would just like to
    say thanks a lot for a tremendous post and a all round thrilling blog (I also love the theme/design), I don’t have time to go through it
    all at the moment but I have bookmarked it and also included your
    RSS feeds, so when I have time I will be
    back to read a great deal more, Please do keep up the awesome job.

  12. Howdy! This post could not be written any better!

    Reading this post reminds me of my old room mate! He always kept chatting about this.
    I will forward this write-up to him. Pretty sure he will have
    a good read. Thanks for sharing!

  13. hello there and thank you for your info – I have definitely
    picked up anything new from right here. I did however expertise several technical issues using this website, as I experienced
    to reload the website lots of times previous to I could get it to load correctly.
    I had been wondering if your web hosting is OK? Not that I
    am complaining, but sluggish loading instances times will very frequently affect
    your placement in google and could damage your high-quality score if ads and marketing
    with Adwords. Well I am adding this RSS to my email and can look out for much more of your respective fascinating content.
    Ensure that you update this again soon.

  14. Admiring the persistence you put into your blog and detailed information you provide.
    It’s nice to come across a blog every once in a while that isn’t the same outdated rehashed material.
    Excellent read! I’ve bookmarked your site and I’m including
    your RSS feeds to my Google account.

  15. Pingback: Google
  16. Pingback: music theory
  17. Pingback: buy it at sale
  18. Pingback: cbd oil for dogs
  19. Pingback: Best Cafe for Kids
  20. Pingback: how to use dildo
  21. Pingback: Cato Lux
  22. Pingback: America First News
  23. Pingback: Cannabis Oil
  24. Pingback: sàn forex
  25. Pingback: realistic dildo
  26. Disponemos de asistencia técnica en reparacion de lavadoras, reparacion de lavavajillas, reparacion de secadoras, reaparacion de hornos y vitroceramicas, reparacion cocinas, reparacion frigorificos, reparacion microondas, reparacion campanas y termos. Todas las reparaciones de nuestros servicio tecnicos de electrodomesticos en Madrid están garantizadas por escrito y cuentan con una garantía de desde 3 meses. Basándonos en nuestra gran experencia y teniendo en cuenta la gran competencia en reparación de electrodomésticos ofrecemos precios y garantías atractivos, procurando que el cliente nunca pague dos veces por el mismo problema.

  27. Pingback: MrPornGeek
  28. Pingback: Genuine Leather
  29. Pingback: dealing with acne
  30. Pingback: GFCI repair
  31. Pingback: cbd oil near me
  32. Pingback: Google
  33. Pingback: fapidy.com
  34. Pingback: VoIP Services
  35. Pingback: Dank Vapes
  36. Pingback: private chef
  37. Pingback: pressure washing
  38. Servicio técnico Whirlpool Barrio del Pilar Madrid atiende todas las reparaciones de electrodomésticos Whirlpool en la ciudad de Barrio del Pilar Madrid. Ingenua de mi llamo y me dice que me ponga en contacto con el servicio técnico que es a su vez el servicio de atención al cliente, me atienden mas bien mal, una señorita que se llama Katy (me dijo su nombre) sin saber nada mas y sin ver fotografias afirma categoricamente qu ele he dado un golpe, y tras mi insistencia me dice que mande una foto.

  39. Compre una cafetera cm1 22 hace un mes en media markt se rompio el pocillo y minimoka ni meda markt se hizo cargo de la reparacion por eso minimoka y media markt por pueden cerrar las puertas. Hola, Luis, en este enlace encontrarás todos nuestros Servicios Técnicos Oficiales de la provincia de Valencia para que escojas el que más te convenga y le solicites la pieza que necesitas. Hola, Manuel, seguimos sin entender porqué te han dicho que no había recambios, cuando la pieza que necesitas está disponible y así se le ha informado al Servicio Técnico. Hola Ramón, Para solucionar tu incidencia deberás acudir a un Servicio de Asistencia Técnica.

  40. Pingback: strap on harness
  41. Pingback: app apk for laptop
  42. Disponemos de filtros de agua para frigoríficos americanos de todas las marcas y filtros antibacterias. Mantenimiento y la reparación de averías en sus aparatos electrónicos como televisores, pantallas y monitores, dvd, equipos de sonido Hi-Fi, cámaras foto-vídeo, proyectores, TDT, antenas colectivas, etc. Si bien esta opción de bloqueo de Cookies en su navegador puede no permitirle el uso pleno de todas las funcionalidades del Website. Atendemos cualquier duda que pueda producirse en el funcionamiento y mantenimiento de tu electrodoméstico Brandt.

  43. Pingback: panty vibrator
  44. Status Liker, Auto Like, Working Auto Liker, Status Auto Liker, auto liker, Autoliker, autoliker, Increase Likes, Photo Liker, Autoliker, Autolike International, autolike, ZFN Liker, Photo Auto Liker, Autolike, auto like, Auto Liker

  45. Pingback: BUY WEED ONLINE
  46. Excelente la pagina, escribo para decir que tengo una nevera no frost tecnico le puso el gas porque se llamo para eso ya que este se le habia acabado pero que do con el problema de que se congela en la parte de atras y cada dos tres dias hay que descongelarla y no se puede dejar para hacer cubos de hielo y no enfria nada en la parte solo se congela en la parte de atras ayudaaaaa gracias.

  47. Pingback: Dank Vapes
  48. Pingback: WebStorm Crack
  49. Pingback: Pegging sex toys
  50. Pingback: blue sex pills
  51. Pingback: Elite IT
  52. Epígrafe 3 3.1.- Equipo, componentes, accesorios y piezas de repuesto de motores para vehículos automóviles (excepto equipo eléctrico). Epígrafe 3 3.2.- Equipo, componentes, accesorios y piezas de repuesto de carrocerías para vehículos automóviles. Epígrafe 3 3.9.- Otro equipo, componentes, accesorios y piezas de repuesto para vehículos automóviles (excepto equipo eléctrico). Epígrafe 3. .- Balanzas de precisión y otros instrumentos y aparatos de medida dimensional de precisión.

  53. Pingback: strap on dildo
  54. Pingback: is CBD legal
  55. No me creo que sean tan informales y no se pueda conseguir por ningún medio que nos atiendan, y al parecer da igual que sea de Granada, Córdoba de donde sea, impresentables en general. Tras mandarles una reclamación en impreso oficial via postal certificado y acuse de recibo he conseguido el abono de dicha factura. Hola, se me ha roto una goma de mi horno fagor que se cambia en un minuto (ni mas ni menos) y me piden 2 euros. Le digo que no me la cambie, y me ha cobrado 35 euros por desplazamiento, siendo que estan muy cerca de mi casa NUNCA MAS NADA DE FAGOR.

  56. Pingback: CBD oil
  57. Pingback: 1000 mg CBD oil
  58. Pingback: CBD oil
  59. Pingback: broad spectrum
  60. Pingback: bondage
  61. Pingback: pornstars
  62. Servicio Técnico electrodomésticos Madrid, pionero en reparaciones de electrodomésticos en Madrid , con más 24 años reparando todo tipo de electrodomésticos, ponemos a su disposición a nuestro personal técnico para resolverle cualquier tipo de incidencia que pueda presentar el aparato, el mismo día de su aviso.

  63. Pingback: Best Smartwatches
  64. Pingback: webehigh
  65. Pingback: Royal CBD
  66. Pingback: CBD products
  67. MECANIZADOS DE PRECISION INDE SL no ha presentado aún sus cuentas. Nuestro mejor producto es la satisfacción de nuestros clientes, para ello contamos con maquinaria competente, instalaciones adecuadas y con un equipo humano de dilatada experiencia en nuestro sector.

  68. Con la tecnología CNC, los cortes empleados por los tornos se llevan a cabo con precisión y alta velocidad. Se realiza a partir de productos semielaborados como lingotes , tochos u otras piezas previamente conformadas por otros procesos como moldeo forja Los productos obtenidos pueden ser finales semielaborados que requieran operaciones posteriores.

  69. Pingback: Fundmerica
  70. Pingback: CBD oil for pain
  71. When I initially left a comment, I clicked the “Notify me when new responses are added” checkbox plus now every time the comment is added I actually get several emails using the same comment. Is generally there in whatever way a person can remove people since a result service? Thanks a lot.

  72. Pingback: buy CBD products
  73. Pingback: onhax
  74. Pingback: best CBD store
  75. Pingback: web series
  76. Pingback: Vape Shop
  77. Pingback: travel
  78. Pingback: MyInforms
  79. Pingback: CBD oil near me
  80. Pingback: best dildos
  81. Pingback: cbd overdose
  82. Pingback: shopify cbd
  83. Pingback: royal cbd
  84. Pingback: insomnia
  85. Pingback: shipping
  86. Pingback: pussy masturbator
  87. Pingback: sex toys
  88. Pingback: domain authority
  89. Pingback: kiu
  90. Pingback: beginner sex toys
  91. Pingback: MILF porn
  92. I was curious should you ever considered changing the structure of your respective site? Its really well written; I adore what you’ve got in order to say. But maybe an individual could a little extra when it comes to content so men and women could connect with that better. You have got an horrible lot of text intended for only having one or perhaps 2 pictures. You may may space it out much better?

Leave a Reply

Your email address will not be published.