Lookup Fields

I have a field called meeting_type_id which links to the Meeting_type table. I have placed the meeting_type_id on a form. I have overwritten the lookup method. I want to be able to select a meeting_type and display the text in the field but still assign the recID(Meeting_type Table) value to meeting_type_id. Is this possible, will appreciate the help. Thank-you.

Well, in cases like this, you should use a display or edit method. Better the second one. But the form will work slower, because the system will have to lookup a field in a different table for every record. But, it can be done.

I understand how to do a display method i.e display str getMeetingType() { return MPBMeetingType::find(MPBMeeting.MeetingTypeID).MeetingType; } how would you do a edit method ? Does this mean i can even implement a lookup ? If so how ? could you please give me an example. thankyou

check out the markTrans Method on CustTransOpen datasource of CustOpenTrans form. it’s a big one, but the principle is the same or any other edit method. Launch a search on Forms for keyword “edit”. it works as a display method, but you can specify a value in there too. edit Description meeting_type(boolean set, Table3 tableBuffer, Description _tRecId) { Description localText; if (set) { tableBuffer.selectForupdate(true); tableBuffer.RefRec = str2int(_tRecId); tableBuffer.update(); localText = Table1::find(tableBuffer.RefRec).Field1; } else { localText = Table1::find(tableBuffer.RefRec).Field1; } return localText; } and the lookup will look like this: (you have to use a form to retern the RecId in the closeSelect method()) Args args = new Args(formStr(Form2)); FormRun form1; ; form1 = classFactory.formRunClass(args); this.performFormLookup(form1); But you will also have to think of a way to prohibit editing of this control. That’s actually a very bad way to use Axapta, I think. :slight_smile: