mibuso.com

Microsoft Business Solutions online community
It is currently Wed Sep 03, 2014 6:43 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 5:40 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
Hello all,

I have added a field Inventory on the Purchase Line of my Purchase Order which check the Quantity for items per location defined.

I have added a Flowfield on the field Inventory on the table: Sum("Item Ledger Entry".Quantity WHERE (Item No.=FIELD(No.),Location Code=FIELD(Location Code)))..

For e.g: I have chosen Item A and Location Code Green which returns a Quantity of 2 in my Inventory field..
Now, I have change Location Code to White which has a zero quantity but it is giving 2 as quantity.
It is not being updated accordingly. I have to click on the Sales Header part for it to update.

How can I refresh the Quantity without clicking on the form?

Also I have used: CurrForm.UPDATECONTROLS on the Location Code- OnValidate

Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 5:51 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 345
Country: Canada (ca)
Similar issue has been discussed previously. :)

Please Search the form.


Top
 Profile E-mail  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 7:32 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7990
Location: Howell, MI
Country: United States (us)
Add a CALCFIELD command for the inventory field to the OnValidate trigger of the Item number and the Location code fields, in the TABLE NOT THE FORM.

You need to stop programming forms for data validation. The form triggers are for display purposes only. Data validation should be programmed on the table level.

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 9:29 pm 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
DenSter wrote:
You need to stop programming forms for data validation. The form triggers are for display purposes only


I have not understand your point. Can you please explain me in some details.

Thanks
Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 9:51 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 345
Country: Canada (ca)
Quote:
You need to stop programming forms for data validation. The form triggers are for display purposes only


All your data processing/calculations should be done on the table. Forms are just used to display data (Therefore, as a rule of thumb, you should not do any calculations/validation in the form itself)


Top
 Profile E-mail  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Mon May 07, 2012 10:26 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7990
Location: Howell, MI
Country: United States (us)
liizz wrote:
Can you please explain me in some details.

What I think is happening, is that you open the form in design mode, and you program this code into the OnValidate trigger of the field on the Form object. Instead, you need to figure out which table the form is showing, and program the validation logic into the OnValidate trigger of the field in the TABLE object instead.

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Tue May 08, 2012 6:32 am 
Offline

Joined: Wed Apr 07, 2004 9:39 am
Posts: 356
Location: Bangalore
Country: India (in)
Also, I fail to understand why you need to add the Inventory field in the Purchase Line table? If you need to display the stock balance of an item in combination to it's location, you can calculate the Inventory by taking a record variable for Item and write a code to filter and then issue a CalcFields for Inventory field and get the balance in a variable. Then display the variable in the Purchase Line with a calculated field.

Chn


Top
 Profile E-mail WWW  
 
 Post subject: Re: Quantity for items per location not updated.
PostPosted: Tue May 08, 2012 6:43 am 
Offline

Joined: Mon Oct 24, 2011 2:58 am
Posts: 142
Location: Tokyo
Country: Japan (jp)
liizz wrote:
Also I have used: CurrForm.UPDATECONTROLS on the Location Code- OnValidate
Liizz


Try using CurrForm.UPDATE

_________________
Microsoft Certified IT Professional for Microsoft Dynamics NAV

Just a happy frood who knows where his towel is


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: