{"id":1525,"date":"2018-06-27T14:37:30","date_gmt":"2018-06-27T11:37:30","guid":{"rendered":"http:\/\/guvensahin.com\/?p=1525"},"modified":"2020-05-12T23:56:44","modified_gmt":"2020-05-12T20:56:44","slug":"dynamics-ax-2012-x-ile-is-iliskisi-olusturmak-smmbusreltable","status":"publish","type":"post","link":"https:\/\/guvensahin.com\/tr\/dynamics-ax-2012-x-ile-is-iliskisi-olusturmak-smmbusreltable\/","title":{"rendered":"Dynamics AX 2012: X++ ile \u0130\u015f \u0130li\u015fkisi Olu\u015fturmak (smmBusRelTable)"},"content":{"rendered":"<p>Bir proje i\u00e7in ax 2012&#8217;de koddan &#8220;i\u015f ili\u015fkisi&#8221; (smmBusRelTable) olu\u015fturmam gerekti. A\u015fa\u011f\u0131da verdi\u011fim \u00f6rnek kod ile bu i\u015flemi kolayl\u0131kla yapabilirsiniz.<\/p>\n<p>Kodda s\u0131ras\u0131yla:<\/p>\n<ul>\n<li>\u00d6nce \u0130\u015f ili\u015fkisi i\u00e7in gerekli party&#8217;yi olu\u015fturuyoruz. (DirPerson yada DirOrganization)<\/li>\n<li>Bu party&#8217;den t\u00fcreyen bir i\u015f ili\u015fkisi (smmBusRelTable) yarat\u0131yoruz.<\/li>\n<li>Olu\u015fturdu\u011fumuz i\u015f ili\u015fkisi i\u00e7in varsa adres ve ileti\u015fim bilgilerini giriyoruz. (LogisticsPostalAddress, LogisticsElectronicAddress)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<pre>\/\/ G\u00fcven \u015eahin - guvensahin.com\r\npublic static smmBusRelTable createBusRelTable(\r\n                        boolean _isPerson,\r\n                        str _firstName,\r\n                        str _lastName,\r\n                        str _fullName,\r\n                        str _phone,\r\n                        str _email,\r\n                        str _state,\r\n                        str _address)\r\n{\r\n    smmBusRelTable                  smmBusRelTable;\r\n\r\n    DirParty                        dirParty;\r\n    DirPartyPostalAddressView       dirPartyPostalAddressView;\r\n    DirPartyContactInfoView         dirPartyContactInfo;\r\n    DirOrganization                 dirOrganization;\r\n    DirPerson                       dirPerson;\r\n    DirPersonName                   dirPersonName;\r\n    ;\r\n\r\n    ttsBegin;\r\n\r\n    smmBusRelTable.clear();\r\n    smmBusRelTable.initValue();\r\n    smmBusRelTable.BusRelAccount = NumberSeq::newGetNum(smmParameters::numRefBusRelAccount()).num();\r\n    smmBusRelTable.BusRelTypeId = \"\u0130\u015f \u0130li\u015fkisi\";\r\n\r\n    if (_isPerson)\r\n    {\r\n        _fullName = _firstName + \" \" + _lastName;\r\n\r\n        dirPerson.clear();\r\n        dirPerson.initValue();\r\n        dirPerson.Name = _fullName;\r\n        dirPerson.NameAlias = _fullName;\r\n        dirPerson.NameSequence = DirNameSequence::find('FirstLast').RecId;\r\n        dirPerson.insert();\r\n\r\n        dirPersonName.clear();\r\n        dirPersonName.initValue();\r\n        dirPersonName.Person = dirPerson.RecId;\r\n        dirPersonName.FirstName = _firstName;\r\n        dirPersonName.LastName = _lastName;\r\n        dirPersonName.ValidFrom = DateTimeUtil::minValue();\r\n        dirPersonName.ValidTo = DateTimeUtil::maxValue();\r\n        dirPersonName.insert();\r\n\r\n        smmBusRelTable.Party = dirPerson.RecId;\r\n    }\r\n    else\r\n    {\r\n        dirOrganization.initValue();\r\n        dirOrganization.Name = _fullName;\r\n        dirOrganization.insert();\r\n\r\n        smmBusRelTable.Party = dirOrganization.RecId;\r\n    }\r\n\r\n\r\n    dirParty = DirParty::constructFromCommon(smmBusRelTable);\r\n    dirParty.parmName(_fullName);\r\n    dirParty.parmNameAlias(_fullName);\r\n\r\n    dirPartyPostalAddressView.clear();\r\n    dirPartyPostalAddressView.LocationName      = 'B2B Adres';\r\n    dirPartyPostalAddressView.CountryRegionId   = 'TUR';\r\n    dirPartyPostalAddressView.State             = _state;\r\n    dirPartyPostalAddressView.Street            = _address;\r\n    dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);\r\n\r\n    \/\/ phone\r\n    if (_phone)\r\n    {\r\n        dirPartyContactInfo.clear();\r\n        dirPartyContactInfo.Locator         =_phone;\r\n        dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;\r\n        dirPartyContactInfo.IsPrimary       = NoYes::Yes;\r\n        dirParty.createOrUpdateContactInfo(dirPartyContactInfo);\r\n    }\r\n\r\n    \/\/ email\r\n    if (_email)\r\n    {\r\n        dirPartyContactInfo.clear();\r\n        dirPartyContactInfo.Locator         =_email;\r\n        dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;\r\n        dirPartyContactInfo.IsPrimary       = NoYes::Yes;\r\n        dirParty.createOrUpdateContactInfo(dirPartyContactInfo);\r\n    }\r\n\r\n    smmBusRelTable.insert();\r\n\r\n    ttsCommit;\r\n\r\n    return smmBusRelTable;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Bir proje i\u00e7in ax 2012&#8217;de koddan &#8220;i\u015f ili\u015fkisi&#8221; (smmBusRelTable) olu\u015fturmam gerekti. A\u015fa\u011f\u0131da verdi\u011fim \u00f6rnek kod ile bu i\u015flemi kolayl\u0131kla yapabilirsiniz. Kodda s\u0131ras\u0131yla: \u00d6nce \u0130\u015f ili\u015fkisi i\u00e7in gerekli party&#8217;yi olu\u015fturuyoruz. (DirPerson yada DirOrganization) Bu party&#8217;den t\u00fcreyen bir i\u015f ili\u015fkisi (smmBusRelTable) yarat\u0131yoruz. Olu\u015fturdu\u011fumuz i\u015f ili\u015fkisi i\u00e7in varsa adres ve ileti\u015fim bilgilerini giriyoruz. (LogisticsPostalAddress, LogisticsElectronicAddress) &nbsp; \/\/ G\u00fcven&hellip;&nbsp;<a href=\"https:\/\/guvensahin.com\/tr\/dynamics-ax-2012-x-ile-is-iliskisi-olusturmak-smmbusreltable\/\" rel=\"bookmark\">Daha fazlas\u0131n\u0131 oku &raquo;<span class=\"screen-reader-text\">Dynamics AX 2012: X++ ile \u0130\u015f \u0130li\u015fkisi Olu\u015fturmak (smmBusRelTable)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":916,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[234],"tags":[193,198,285],"class_list":["post-1525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-ax","tag-axapta","tag-dynamics-ax-2","tag-x"],"_links":{"self":[{"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/posts\/1525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/comments?post=1525"}],"version-history":[{"count":6,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/posts\/1525\/revisions"}],"predecessor-version":[{"id":1531,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/posts\/1525\/revisions\/1531"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/media\/916"}],"wp:attachment":[{"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/media?parent=1525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/categories?post=1525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guvensahin.com\/tr\/wp-json\/wp\/v2\/tags?post=1525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}