How to set display fields on form to Table field..

Hello,

I have created one Table that get lookup from UserInfoTable. Corresponding i have create form for the same. When i click on Userid on the form then lookup appear and i select any user name corresponding networkAlias are fill into Alias field in form. This networkAlias come from UserInfoTable of that corresponding table. Now i want to save this networkAlias to my Table field called Alias. To getting networkAlias on the form I have do following code for the same:

display SystemAccountName osAccName(II_FSA_Users _II_FA_Users)
{
UserInfo userInfo;

select firstonly userInfo where userInfo.id == _II_FA_Users.II_UserName;
if (userInfo)
return userInfo.networkAlias;
return ‘’;

}

I have write display method on Form DataSource. Now how can i insert it to corresponding field Alias into My Custom Table. Please help on this. Probably i have spent half day on the same. It’s driving me crazy.

Hi,

I will answer your question Of course what I understand,first sorry my english not very well I hope you will understand me.

userInfo.id == _II_FA_Users.II_UserName; You want to ınsert your table and field Id ,but you don’t use any update method for userInfo table,so you don’t see ıt

for insert you will select your table which you want to insert then assign your value and update it use mytable.update or use select for update or find(…,true);

I hope this help you,good working and not be crazy ;))

Thanks for your Answer. yes you are right i want to insert value that come up with : select firstonly userInfo where userInfo.id == _II_FA_Users.II_UserName;

II_FSA_Users.II_Alias = userinfo.networkAlias;

Now i want to insert a networkAlias into my Custom Table field Alias. can you please suggest where am i suppose to write this code?? Form level?? Table Level?? and in which method and what code i have to write into.

Thanks,

I don’t know your senario. this status change what do you want to do,first you don’t write select firstonly only use ‘select forupdate tablename’ and assingn then use mytable.update

this is also get first record ,you will try write it your fetch method on form or write data source init method ,I wondered why use write in display method? İf you want to display a variable you set it fetch method and describe classdeclaration then display it use display method,You don’t put insert /update code in display method this is just suggest.

You can ask your question all time ,good working.

With something like the following on the table, you could select the user id in the lookup but display the alias in the form control:

//BP Deviation Documented
public edit SystemAccountName osAccName(
boolean _set,
SystemAccountName _userName)
{
UserInfo userInfo;
;

if (_set)
{
this.II_UserName = _userName;
}

select firstonly userInfo
where userInfo.id == this.II_UserName;

return userInfo.networkAlias;
}

If you really need to store the alias in another table, then you could do so by overiding the insert and/or update methods on the table. Hope this helps.

Hie, Hulya / Daniel Kuettel

Thanks for your all help and support. I have done it.

I have write same code on Modified method of Form DataSource and its work.

[Y]

Hi,

I know it’s been awhile…could you please post your solution…i have the same case but it doesn’t work.

Thanks!

Hi Bhavin,

Can u please post the code of modified which stores the display method in a field.

Thanks in Advance

Regards,

Alonso