mojaSymfonia FORUM https://forum.mix-soft.pl/ |
|
notatka https://forum.mix-soft.pl/viewtopic.php?f=15&t=4999 |
Strona 1 z 1 |
Autor: | supersebek [ 2013-06-14, 08:32 ] |
Tytuł: | notatka |
Napisałem raport w procedurze dok. magazynowego, który otwiera pole edycyjne notatki przy onkhchanged. Gdy jednak chwile się na nim popracuje i zaloguje na innego użytkownika to program przy wyjściu z dokumentu się wiesza. oto kod: Kod: int Sub OnKhChanged(long lId) baseall bd bd.setbase("BM") bd.setkey("id") bd.setkeyseg("id", lId) if bd.getrec(EQ) == 0 then //message using "%l", bd.getfield("khid") baseall nt nt.setbase("NT") nt.setkey("super") nt.setkeyseg("typi", 0) nt.setkeyseg("baza",20) nt.setkeyseg("super", bd.getfield("khid")) err = nt.GetRec(EQ) if err == 0 && nt.getfield("opis") != "" then notatka1 = nt.getfield("opis") else notatka1 = "" endif FORM "Notatka", 752, 520 BUTTON "Anuluj", 600, 336, 72, 24,-1 id1 = BUTTON "Zapisz", 516, 336, 72, 24, 3 MEDIT "Notatka kontrahenta", notatka1, 116, 4, 556, 312 rv = Execform oncommand2 if(nt.GetField("typi") == 0 && nt.GetField("baza") == 20 && nt.GetField("super") == bd.getfield("khid")) then //jest już notatka, więc update message notatka1 if nt.getfield("opis") != notatka1 then nt.SetField("opis",notatka1) message "update" err = nt.Update() endif else //jeszcze nie ma , tworzę nt.clear() if notatka1 != "" then message "new" nt.SetField("typi",0) nt.SetField("baza",20) nt.SetField("super", bd.getfield("khid")) nt.SetField("opis",notatka1) err = nt.Insert() endif endif /* if(!err) then Message("zmieniłem") else Message(using "Błąd nr %d", err) endif */ //message using "%l", nt.getfield("super") endif EndSub int sub onCommand2(Int id, Int msg) if id == id1 then save endif EndSub |
Autor: | supersebek [ 2013-06-14, 09:38 ] |
Tytuł: | Re: notatka |
Kod: baseall nt nt.setbase("NT") nt.setkey("super") nt.setkeyseg("super", 65536) nt.setkeyseg("typi", 0) nt.setkeyseg("baza",20) if nt.getrec(EQ) == 0 then message nt.getfield("opis") endif jak pobieram na czystej bazie nowo utworzonej pole opis to się wiesza. symfonia 2013.1.b |
Autor: | Misiek [ 2013-06-14, 09:45 ] |
Tytuł: | Re: notatka |
Hej, Dopisz na początku (dowolne miejsce przed otwarciem bazy NT) linijkę: Kod: Limit 10000 i to powinno rozwiązać Twój problem ![]() Daj znać czy pomogło ![]() (w roku 2001 pisząc jedno ze swoich pierwszych rozwiązań, spędziłem 1,5 miesiąca nad szukaniem błędu, program Symfonia Handel wieszał się co jakiś czas, z niewiadomych powodów - jak się później okazało, w/w polecenie było za to odpowiedzialne). Polecenie LIMIT należy ZAWSZE stosować w przypadku, gdy otwierasz bazę NOTATEK/NT - jedno z pól zdefiniowanych w tej bazie to 8 kB i stąd wymaga to stosowania w/w polecenia. |
Autor: | rafal [ 2013-06-14, 09:47 ] |
Tytuł: | Re: notatka |
Kod: limit 8000 baseall nt nt.setbase("NT") nt.setkey("super") nt.setkeyseg("super", 65536) nt.setkeyseg("typi", 0) nt.setkeyseg("baza",20) if nt.getrec(EQ) == 0 then message nt.getfield("opis") endif |
Autor: | supersebek [ 2013-06-14, 09:59 ] |
Tytuł: | Re: notatka |
dzięki. Pomogło. pozdrawiam |
Strona 1 z 1 | Strefa czasowa UTC+1godz. [letni] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |