Dear Experts,
In item card there is a field called Vender no. I've created one form which is desinged on the base of Table no. 37 Sales line.
But in that form i want that Vendor no. field. I have tried to created new variable named item within that form. i gave the datatype
as RECORD and i gave source expression as ITEM.VENDOR NO.
but it is not coming in that form.
Please tell me that how can i bring the field Vendor no. in my newly created form which is designed on (Table 37 Sales Line).
i know vendor no. field is not part of Table 37 but i need that field in my newly created form.
Waiting for earliest reply.
Thanks & Regards,
Fahd
0
Comments
First add the field "Vendor No." to the table - Code(20) (50000+ range)
If you look at the code behind the sales line table you will see
OnValidate of "No." that many fields are filled.
What you're looking for is the part where it says...
Type::Item:
.....
.....
.....
you will see other item fields tax groups, posting groups, etc being transfered.
You would add
"Vendor No." := Item."Vendor No.";
The "GET" is already been fired so you don't need that here.
**now if you want this "Vendor No." field value to transfer over to the posted Invoice & Shippments,
You'll have to add the same Field to those other tables - using the Same Name & Number & Size.
http://www.BiloBeauty.com
http://www.autismspeaks.org
First of all thanks for such a detailed reply.
I have tried adding up a field in Sales Line table. But it says "your license does not allow you to create a field". Even i have used the developer license.
My license only allows me to add the field up in Table 27 Item.
I was wondering if without creating field in Sales line table. Suppose if i want to create a form based on Sales line table. Can i bring the vendor no. field in the form??? if yes then please bear with me and let me know.
Thanks & Regards,
Fahd
NAV Developer
Thanks !!!
But, I created on variable named ITEM, i selected that data type as a RECORD & subtype as ITEM.
Then i came to the ONGETAFTERRECORD TRIGGER.
I mentioned like this.
item.GET ("Vendor no.");
but its is saying unknown variable "VENDOR NO.".
Please tell me more i think i m making mistake somewhere?
Regards,
Fahd
if type = type::item then //<- sales line has to be type item or you'll get for example item.get(g/l account number)
item.get("No."); <- get is the function where you GET a record with parameters primary key (vendor no. is not a primary key)
item."vendor no." => your wanted data
But I really suggest to take a look at documentation, msdn, and other training materials.
|To-Increase|
what filed id number are you using?
http://www.BiloBeauty.com
http://www.autismspeaks.org
It's generating itself the new field number after the last one. I know there is some specific series of numbers that i can start with. But i don't know from where that series starts. so i just started the next generated number.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
This information can be retrieved from standard learning materials.
And although NAV generates a fieldnumber, they are suggestions, they will always be the number of the previous field (one row above) +1 unless that number is already assigned. Then it will choose the next available number in that range.
I (and I think I can say We) recommend learning materials and training to gain knowledge of C/Side.
Also, could you please confirm you are not working on any real NAV projects? At least not until you've gained (much) more experience.
|To-Increase|
Thanxxxxxx alottt. It's done. now it i showing me the field now, I really appreciate your help sir. thanx every one as well.
Type::Item:
is that if it's just anywhere you run into the problem of Item.Get("No.") failing.
like if you use a g/l account no for example.
So by executing the code when you know the "NO" has to be an item number solves that.
Else you should use a If Item.Get("No.") then...else.....
to avoid a crash.
Just some extra info you can keep in mind as I saw you were having problems understanding the "GET".
It's the little things.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Really appreciate your help thanks alot for that .