Hi,
I've a Form that contain a textbox (the txtbox shows a field of a table), and this textbox have a call to another Form (lookup). I want that, when i select any data in the lookup, this data save in the textbox and the field in the table.
The textbox has LookUpFormID: 50001 and
SolOrigen - OnLookup(VAR Text : Text[1024];) : Boolean
FORM.RUNMODAL(50001);
But i don't know how to say "Save this, here"
I don't find the way...
Regards
0
Comments
-In the table (the sourcetable of your form 50001) where the value is that you want to select, you just have to put property "LookupFormID" to the form of the list (in your case 50001).
An example of this system:
-Table 3 : check the property "LookupFormID"
-Table 36 : field "Payment Terms" : check property "TableRelation"
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
i added a field in table "Purchase Header" called DATA.
In a form, i have a textbox that show this data. I want that, when an user wants to change this data, push on the lookup in this textbox and select one record of this field in table Purchase Header.
I,ve tried this you tell me, but doesn`t work.
Is the same table In the Table Properties? How? Because i open the Design Mode, but only can view the fields properties.
Maybe C/AL code?
Can be, in OnPush() the ComandButton to Accept the lookup Form, give the data of the selection to the textbox in Form???
Regards
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
-you have a new table and a new form (your form 50001).
In the table you need to set tableproperty "LookupFormID" to your form. This tells the table to use the form when an lookup-action is done on the form. Your form needs 2 buttons : Ok and Cancel with certain properties set (if you create a new form connected to a table with the form-wizard, this is done automatically).
To view the table-properties of a table, go into design and go to the place to create a new field in the table without creating the field. Then you will see the tableproperties.
-in field of the other table ("Purchase Header".DATA), you just need to set the property TableRelation of the field.
Don't run table "Purchase Header" directly because it is possible the lookup to select a value doesn't work. But put the field on a form and run that form.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I use Form 50 (Purchase Order). I'm created a Textbox where i can saw number of application for a order.
Ex. Order: 11001 ---> Application: 0012
Well for this data (Application) i create in Table 38 a new field, called "OLD APP".
There is cases that one Application maybe create various Orders. Application: 0013 ---> Order:11002, Order:11003. I want the user click on this textbox of Form 50 (ORDER), and select Application number from a new Form where can see all the orders with their applications. When select, aplly this value in Table 38 new field.
Actually i can saw the new form, cliking textbox, but when i select the application, the textbox don't take this value.
So, you don't have a new table with the Application-numbers in it? But you show and select a purchase order that has some application number.
This is the code for it: (like kine already wrote).
OnLookup-trigger of the field
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
In Form 50 (Purchase Order) i have the Textbox with SourceExpression "Purchase Header.OLD APP". The Textbox Properties, in LookUp is YES, and C/AL Code TextBox.LookUp() i put FORM.RUNMODAL(50013);
When i push on LookUp in Textbox, the 50013 Form appears. And now, i want select one field in this Form 50013 (OLD APP one of this) and when i push Accpt in the form, the form close and the Textbox have the "OLD APP" Value.
Last parrafe is only i need.
Once you put the code in the table, post the code you put so I can check it.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I don't know the code. This is the problem. I don´t know how can i get the value from Form 50013 pushing "Accept" bottom and save it in OldApp field (Table 38) in the open Order from form 50.
Now in the OldApp - LookUp() only have FORM.RUNMODAL(50013);
Regards
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Yes, i put the code (modify for me)and work...
¡¡FINE!!
Thank you kriki
This doesn't work if you RUN the table from the Object designer and push F6 and click on OK :shock:
But run a form, push F6 and click OK it works. :?:
I'am using 4.02
In older (I think <=3.7) versions that worked. At least I can't remember having encountered the problem.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I just wanted to change the onlookup in a few minutes and after an hour of disbelieve gave it up and posted this message.