Hi Cenk: try to insert one more line before you select command: p.company('ntr'); this will change your dataareaid to ntr company, and that will make your select command work. Good luck Jeffery
--- In development-axapta@yahoogroups.com, "Cenk Ince" <[EMAIL PROTECTED]> wrote: > > Hi all; > > We have 2 company ntr and spk. When i post a salespackingslip in "spk", i want to post purchpackingslip in "ntr". > I wrote a job below, it works in "ntr" company without redlines, when i run it in "spk" company with redlines it doesn't work. > > Why can it be? > In class purchformletter\run method, there is a while, it "ntr" company it gets into while, but in spk(with red lines) it doesn't get into while. > > while (Query.next()) > > > static void defterenakil(Args _args) > { > PurchTable p; > PurchFormLetter_Invoice purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip); > ; > changecompany("ntr") > { > select p where p.PurchId == "00000342_056"; > purchFormLetter.update(p,"A-114663",systemDateGet (),PurchUpdate::All,AccountOrder::None,NoYes::No,NoYes::Yes); > } > > } > > Thanks.. > > Cenk ÝNCE > > > [Non-text portions of this message have been removed] >