INTERNAL_REFERENCE alanı ile Fişi kaydettikten referansını elde edebilmekteyiz Aşağıda bu konu ile ilgili örnek bulunmaktadır.
int gunref = 0;
UnityObjects.Data salesservices = Global.UnityApp.NewDataObject(UnityObjects.DataObjectType.doSalesService);
salesservices.New();
salesservices.DataFields.FieldByName("CODE").Value = "HIKZMETBAN02";
salesservices.DataFields.FieldByName("AUXIL_CODE").Value = "ar";
salesservices.DataFields.FieldByName("AUTH_CODE").Value = "u";
salesservices.DataFields.FieldByName("VAT_PERC").Value = 18;
salesservices.DataFields.FieldByName("UNITSET_CODE").Value = "05";
salesservices.DataFields.FieldByName("CREATED_BY").Value = 1;
salesservices.DataFields.FieldByName("UNITS").Value = "ADET";
UnityObjects.Lines gl_links_lines = salesservices.DataFields.FieldByName("GL_LINKS").Lines;
gl_links_lines.AppendLine();
gl_links_lines[gl_links_lines.Count - 1].FieldByName("INFO_TYPE").Value = 1;
gl_links_lines[gl_links_lines.Count - 1].FieldByName("GLACC_CODE").Value = "111";
gl_links_lines[gl_links_lines.Count - 1].FieldByName("OHP_CODE").Value = "MASRAF01";
salesservices.DataFields.FieldByName("RETURNVAT").Value = 18;
salesservices.DataFields.FieldByName("DEDUCTION_PART1").Value = 2;
salesservices.DataFields.FieldByName("DEDUCTION_PART2").Value = 3;
if (salesservices.Post() == true) {
MessageBox.Show("POST OK !");
gunref = salesservices.DataFields.FieldByName("INTERNAL_REFERENCE").Value;
UnityObjects.Data sales = Global.UnityApp.NewDataObject(UnityObjects.DataObjectType.doSalesService);
sales.Read(gunref);
sales.DataFields.FieldByName("AUXIL_CODE").Value = "ER";
if (sales.Post()) {
MessageBox.Show("Güncelleme İşlemi gerçekleşti");
} else {
if (salesservices.ErrorCode != 0) {
MessageBox.Show("DBError(" + salesservices.ErrorCode.ToString() + ")-" + salesservices.ErrorDesc + salesservices.DBErrorDesc);
} else if (salesservices.ValidateErrors.Count > 0) {
string result = "XML ErrorList:";
for (int i = 0; i < salesservices.ValidateErrors.Count; i++) {
result += "(" + salesservices.ValidateErrors[i].ID.ToString() + ") - " + salesservices.ValidateErrors[i].Error;
}
MessageBox.Show(result);
}
}
} else {
if (salesservices.ErrorCode != 0) {
MessageBox.Show("DBError(" + salesservices.ErrorCode.ToString() + ")-" + salesservices.ErrorDesc + salesservices.DBErrorDesc);
} else if (salesservices.ValidateErrors.Count > 0) {
string result = "XML ErrorList:";
for (int i = 0; i < salesservices.ValidateErrors.Count; i++) {
result += "(" + salesservices.ValidateErrors[i].ID.ToString() + ") - " + salesservices.ValidateErrors[i].Error;
}
MessageBox.Show(result);
}
}
Cevap vermek için giriş yapmanız gerekmektedir.
Soru sormak için lütfen oturum açınız.
Kayıt işleminden sonra referansa ulaşma
17/03/16 15:28   Tiger/Logo Object Designer (LOD)Logo Objects ile bir Fişi kaydettikten sonra nasıl referansına ulaşıp kaydedilen fişi güncelleyebiliriz?
LObjects XML