i have a form say “from1” which is connected tothe Employee master,form1 has a field to capture the vendor account no.
i want to display the vendor account no once when i select the vendor account no in my employee master .how can i do?
-Regards,
Rajee
Hi Rajarajeshwari,
Its not clear…can you explain…
Naresh Kolli
shon4z
March 1, 2011, 10:24am
3
Hai Raji,
The similar post has been already discussed here.
what you can do is you can update form1 vendor account by writing update method -overriding the modfied method of vendor account in empltable(form/table-any)…i hope both are related thru emplid.
ok,
In EmplMaster—>Functions—> Details …which is customized by me… this Details form has some fields amoung which “Vendor Acc no” is one. In EmplMaster form when i select the **“Vendor Acc no”…**The “Vendor Acc no” field in the DETAILS Form should automatically get filled in by the “Vendor Acc no” which i selected in the EmplMaster form
shon4z
March 1, 2011, 10:35am
5
override modfied method empltable level
case (empltable, vendacct)
select forupdate detailstable where detailstable .emplid == this.emplid;
ttsbegin;
detailstable .vendacct= this.vendacct;
detailstable .update();
ttscommit;
this will do.
Hi Rajarajeshwari,
As said by Shon it can be done,there would be any case that no record in the details table for the related employee…
If that case exists you need to insert the record also,if records exists it should be updated as above…
Naresh Kolli
ok,but alreadt the modified field has this code . how to proceed now ?
if(trvPartyEmployeeRelationship.AccountNumber == ‘’)
{
trvPartyEmployeeRelationship.AccountType = LedgerJournalACType::Vend;
trvPartyEmployeeRelationship.AccountNumber = emplTable.psaVendAccount;
emplTable_ds.object(fieldnum(EmplTable, psaVendAccount)).allowEdit(false);
trvPartyEmployeeRelationship_ds.executeQuery();
emplTable_ds.executeQuery();
trvPartyEmployeeRelationship_ds.refresh();
Empl_VendBankAccount_ds.refresh();
emplTable_ds.refresh();
}
shon4z
March 1, 2011, 10:55am
8
the corresponding code is from the modified () of the trvPartyEmployeeRelationship rite!!
in ua case:
u have to override the modified method of employee table and replicate the code as i suggested above.
No Shon,
That code is in the EmplTable(form)—>DataSource—>EmplTable---->PSAVendAccount(field) — >modified Method
shon4z
March 1, 2011, 11:07am
10
well–thats fine!!
it will execute based on that condition, and ua case is different, if vend acct is filled in empl table. it shoul update details form.
so i would be happy if you try the code and check its working or not—execute it empltable(Table level not form)-Methods-Override Modified ().
Shon,
i have just copy pasted ur code in the Empltable (table) —>modified method…
but it dint work [:(]
shon4z
March 1, 2011, 11:28am
12
it dint get updated??
.debugg and see whats happening…coz it shud wrk fine
and also i believe u have a record already in place in details form befre u select the vend acct in empltable… right??
HI Rajarajeshwari,
if the code is there in the EmplTable(form)—>DataSource—>EmplTable---->PSAVendAccount(field) — >modified Method no probelm,add the code as follows after the existing code…it will eork
if(EmplTable)
{
ttsbegin;
select detailstable where detailstable .emplid == this.emplid;
detailstable.selectforupdate(true);
detailstable.vendaccount= EmplTable.psaVendAccount;
detailstable.update();
ttscommit;
}
Naresh Kolli
yes Shon,i select the vend Acc no from EmplTable…which i should automatically get updated in the details form
And naresh, there is no reaction when i include the code in the EmplTable(form)—>DataSource—>EmplTable---->PSAVendAccount(field) — >modified Method …
shon4z
March 1, 2011, 12:05pm
15
did you debug??
also , you have already records in your details table…!! only vendor acct against each needs to be updated based on your selection.
correct my understanding if wrong!!
for the same details form i’ve displayed the employee id.i.e whn i open the Details form,the employee id is displayed automatically …for that i’ve written code in the EmplTable(form)—>DataSource—>Detailsform---->Active Method,which works fine,but why not for the vendor acc no?
public int active()
{
int ret;
;
Detailsform.EmplId = Empltable.EmplId;
ret = super();
return ret;
}
shon4z
March 1, 2011, 12:14pm
17
so here we go – i guess you dont have record to update !!!
record is created when you open details form right??
then you can over ride init value method of table or form of ‘details’
eg:
select firstonly empltable where empltabel.emplid == detailstable.emplid
detailstable.vend acct == empltable.vendacct.
yes shon, you are correct… yes i debugged it but no change…
my details form is similar to the "\Forms\VendTable\Designs\Design[ButtonGroup:ButtonGroup][MenuButton:MenuButtonSetup]\MenuItemButton:Accounts"
shon4z
March 1, 2011, 12:31pm
19
so did u try initvalue method??
In the select statement
select detailstable where detailstable .emplid == this.emplid to Empltable.emplid ; it will work
Naresh Kolli