LOD içerisinde 2 türlü aktarım işlemi yapılabilmektedir
1. İşlem LObjects kullanmadan LOD içerisinde Application nesnesini kullanarak aşağıdaki şekilde aktarım yapılabilmektedir.
Örnekte yapılan işlem ERP ürünü içerisinden Finans modülü altında hareketler altında bulunan kasa işlemlerinde kasa üzerinde sağ tuş işlemler açılan form üzerinde
sağ tuş ekle Faturalar/Verilen Hizmet Faturası ekleme işlemini yapmaktadır
if ctrl="KasaVerilenHizmet" then
sd_trans = Application.NewDataObject(29)
sd_trans.New()
sd_trans.DataFields.FieldByName("TYPE").Value =38
sd_trans.DataFields.FieldByName("SD_CODE").Value ="KASA01"
sd_trans.DataFields.FieldByName("DATE").Value ="10.02.2015"
sd_trans.DataFields.FieldByName("HOUR").Value =15
sd_trans.DataFields.FieldByName("MINUTE").Value =8
sd_trans.DataFields.FieldByName("NUMBER").Value ="~"
sd_trans.DataFields.FieldByName("MASTER_TITLE").Value ="CTS"
sd_trans.DataFields.FieldByName("AMOUNT").Value =3469.2
sd_trans.DataFields.FieldByName("TC_XRATE").Value =1
sd_trans.DataFields.FieldByName("TC_AMOUNT").Value =3469.2
sd_trans.DataFields.FieldByName("CREATED_BY").Value =1
sd_trans.DataFields.FieldByName("CURRSEL_TOTALS").Value =1
attachment_invoice_lines = sd_trans.DataFields.FieldByName("ATTACHMENT_INVOICE").Lines
attachment_invoice_lines.AppendLine()
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("TYPE").Value =9
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("NUMBER").Value ="~"
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("DATE").Value ="10.02.2015"
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("TIME").Value =252184398
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("ARP_CODE").Value ="CRH01"
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("POST_FLAGS").Value =247
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("VAT_RATE").Value =18
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("TC_XRATE").Value =1
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("TC_NET").Value =3469.2
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("CREATED_BY").Value =1
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("CURRSEL_TOTALS").Value =1
transactions0 = attachment_invoice_lines[attachment_invoice_lines.Count-1].FieldByName("TRANSACTIONS").Lines
transactions0.AppendLine()
transactions0[transactions0.Count - 1].FieldByName("TYPE").Value =4
transactions0[transactions0.Count - 1].FieldByName("MASTER_CODE").Value ="HIKZMETBAN01"
transactions0[transactions0.Count - 1].FieldByName("QUANTITY").Value =12
transactions0[transactions0.Count - 1].FieldByName("PRICE").Value =245
transactions0[transactions0.Count - 1].FieldByName("TC_XRATE").Value =1
transactions0[transactions0.Count - 1].FieldByName("UNIT_CODE").Value ="ADET"
transactions0[transactions0.Count - 1].FieldByName("UNIT_CONV1").Value =1
transactions0[transactions0.Count - 1].FieldByName("UNIT_CONV2").Value =1
transactions0[transactions0.Count - 1].FieldByName("VAT_RATE").Value =18
transactions0[transactions0.Count - 1].FieldByName("EDT_CURR").Value =1
transactions0[transactions0.Count - 1].FieldByName("MONTH").Value =2
transactions0[transactions0.Count - 1].FieldByName("YEAR").Value =2015
transactions0[transactions0.Count - 1].FieldByName("AFFECT_RISK").Value =1
'transactions0[transactions0.Count - 1].FieldByName("MASTER_DEF").Value ="UMUTCAN45YAVUZ"
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("DEDUCTIONPART1").Value =2
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("DEDUCTIONPART2").Value =3
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("AFFECT_RISK").Value =1
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("DOC_DATE").Value ="10.02.2015"
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("EDURATION_TYPE").Value =0
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("EXIMVAT").Value =0
attachment_invoice_lines[attachment_invoice_lines.Count - 1].FieldByName("EARCHIVEDETR_INTPAYMENTTYPE").Value =0
sd_trans.DataFields.FieldByName("DOC_DATE").Value ="10.02.2015"
sd_trans.FillAccCodes()
If Not sd_trans.Post() Then
if (sd_trans.ValidateErrors.Count > 0) then
tmpErrStr = "XML Hatası mevcut!"
Cntr = sd_trans.ValidateErrors.Count
For ilp = 0 To (Cntr - 1)
vID = sd_trans.ValidateErrors.Item[ilp].ID
Str(vID, strvID)
tmpErrStr = tmpErrStr + strvID + " , " + sd_trans.ValidateErrors.Item[ilp].Error
Next ilp
warn(tmpErrStr)
Else
tmpErrStr=""
tmpErrStr = "DB Hatası mevcut!"
ErrId = sd_trans.ErrorCode
Str(ErrId, strErr)
ErrDef = ""
ErrDef = sd_trans.DBErrorDesc
tmpErrStr = tmpErrStr + "Hata Kodu : " + strErr + " " + ErrDef
warn(tmpErrStr)
End if
Else
warn("POST OK!")
end if
UnityApp= null
UnityApp.Disconnect
end if
2. İşlem LObjects kullanılarak yapılan aktarım işlemidir.
Örnekte yapılan işlem ERP ürünü içerisinde Satış ve Dağıtım modülü altında hareketler altında bulunan Satış Siparişi formu içerisinde sağ tuş ekleme işlemini yapmaktadır.
if ctrl="SatisSiparis" then
UnityApp = OleObject("UnityObjects.UnityApplication")
UnityApp.Connect()
warn(UnityApp.Connected)
UnityApp.UserLogin("LOGO","")
warn(UnityApp.LoggedIn)
UnityApp.CompanyLogin(1,1)
warn(UnityApp.CompanyLoggedIn)
order = UnityApp.NewDataObject(3)
order.new()
order.DataFields.FieldByName("NUMBER").Value ="~"
order.DataFields.FieldByName("DATE").Value ="13.04.2015"
order.DataFields.FieldByName("TIME").Value =255133748
order.DataFields.FieldByName("ARP_CODE").Value ="CRH02"
order.DataFields.FieldByName("ORDER_STATUS").Value =1
order.DataFields.FieldByName("CREATED_BY").Value =1
order.DataFields.FieldByName("CURRSEL_TOTAL").Value =1
transactions_lines = order.DataFields.FieldByName("TRANSACTIONS").Lines
transactions_lines.AppendLine()
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value =0
transactions_lines[transactions_lines.Count - 1].FieldByName("MASTER_CODE").Value ="MLZ02"
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value =4
transactions_lines[transactions_lines.Count - 1].FieldByName("PRICE").Value =5
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT_RATE").Value =18
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CODE").Value ="ADET"
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV1").Value =1
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV2").Value =1
transactions_lines[transactions_lines.Count - 1].FieldByName("DUE_DATE").Value ="13.04.2015"
transactions_lines[transactions_lines.Count - 1].FieldByName("EDT_CURR").Value =1
transactions_lines.AppendLine()
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value =0
transactions_lines[transactions_lines.Count - 1].FieldByName("MASTER_CODE").Value ="MLZ01"
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value =8
transactions_lines[transactions_lines.Count - 1].FieldByName("PRICE").Value =96
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT_RATE").Value =18
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CODE").Value ="ADET"
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV1").Value =1
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV2").Value =1
transactions_lines[transactions_lines.Count - 1].FieldByName("DUE_DATE").Value ="13.04.2015"
transactions_lines[transactions_lines.Count - 1].FieldByName("EDT_CURR").Value =1
If Not order.Post() Then
if (order.ValidateErrors.Count > 0) then
tmpErrStr = "XML Hatası mevcut!"
Cntr = order.ValidateErrors.Count
For ilp = 0 To (Cntr - 1)
vID = order.ValidateErrors.Item[ilp].ID
Str(vID, strvID)
tmpErrStr = tmpErrStr + strvID + " , " + order.ValidateErrors.Item[ilp].Error
Next ilp
warn(tmpErrStr)
Else
tmpErrStr=""
tmpErrStr = "DB Hatası mevcut!"
ErrId = order.ErrorCode
Str(ErrId, strErr)
ErrDef = ""
ErrDef = order.DBErrorDesc
tmpErrStr = tmpErrStr + "Hata Kodu : " + strErr + " " + ErrDef
warn(tmpErrStr)
End if
Else
warn("POST OK!")
end if
UnityApp= null
UnityApp.Disconnect
end if
Cevap vermek için giriş yapmanız gerekmektedir.
Soru sormak için lütfen oturum açınız.
LOD içerisinden aktarım işlemi
08/06/15 14:12   Tiger/Logo Object Designer (LOD)LObjects gibi LOD içerisinden de aktarım yapabilme imkanım varmıdır?
LOD XML