I have a field(,"Utilised Against Doc No") which has lookup.
requirement: That lookup leads to the posted invoices.Once i select any posted invoice,the correspoding
vendor shipment no field should get updated on the on the same form.I have written the code on
On Validate of the field
"Utilised Against Doc No",but the code is not working.
Situation : But when i tried to copy the document number and paste it instead of using lookup,the code is working and the value is getting reflected in the other field.
purchInvheader.SETRANGE(purchInvheader."No.","Utilised Against Doc No");
IF purchInvheader.FINDFIRST THEN
BEGIN
PurchReciptHeader.SETRANGE(PurchReciptHeader."Order No.",purchInvheader."Order No.");
IF PurchReciptHeader.FINDFIRST THEN
"Vendor Shipment No.":=PurchReciptHeader."Vendor Shipment No.";
END;
What could be the reason?Is it correct to write the code on On validate of that field?
Answers
You can also step through the debugger.
I have used the debugger and came to know that the code is not running at all.Why it is not running?Why the field is not getting validated even after selecting the document number?
Any reasons?What could be the problem?
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
Are you using the default lookup functionality (just setting the TableRelation property on the field) or have you created custom lookup code in the OnLookup trigger for that field?
I am using the default lookup functionality(By setting the TableRelation property)...
The field has some table realation defined as well and the same was written as code on the lookup of the field...That was the reason....
Now i have removed the table relation and have written the code on the lookup of that field and its working fine...
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
yes,i have checked it after looking at your reply....Thank you...
is there anythng on this code which can stop the lookup code not work for the second time?
Any suggestions?
What is the value of "Utilised Against Doc No" of the second line?
If that is not the issue then maybe purchInvheader."Order No." applied as a filter to PurchReciptHeader leads to no records.
The value of "Utilised Against Doc No" is just a lookup field to select the Posted purchase invoice document no
If PurchReciptHeader leads to no records then the field which has to get updated should be empty,but the lookup field itself is not working,i,e it is just showing empty form.
The code which i have posted in the previous post is to update another field on the same form .It is not written for the lookup.
The code should not be in the OnLookup trigger!
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
Then where am i supposed to write the code?
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!