mibuso.com

Microsoft Business Solutions online community
It is currently Tue May 21, 2013 9:50 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Update fields on a Purchase Order
PostPosted: Fri Apr 06, 2012 1:12 pm 
Offline

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

I have done a customised form whereby user has the possibility to create a PO which will create entry in the standard purchase order form(50).

Now, there is a boolean field[Created] will flag to TRUE if its created and I have placed the field(Qty. to Receive which comes from the form 50) on the customised form.

Also, each time when a user wants to change the qty. to receive on form 50 before posting, it should update the field Qty. to Receive found on customised form. And also after posting, it should take the new value for that field.

Please find my codes below:


ReqLineL.SETRANGE(Created,TRUE);
ReqLineL.SETRANGE("Last PO No.",PurchaseLine."No.");
ReqLineL.SETRANGE("Line No.",PurchaseLine."Line No.");
IF ReqLineL.FINDSET THEN BEGIN
REPEAT
ReqLineL."Purch. Qty to Receive":=PurchaseLine."Qty. to Receive";
ReqLineL.MODIFY;
UNTIL ReqLineL.NEXT=0;
END;

The codes are not working actually.

Help me plz..

Thanks

Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Fri Apr 06, 2012 1:26 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
i guess source table of your customized form in Requisition Line..

What value is stored in Requisition Line Last PO No. field? is it Document No. or No.?

Should be

ReqLineL.SETRANGE("Last PO No.",PurchaseLine."No.");
or

ReqLineL.SETRANGE("Last PO No.",PurchaseLine."Document No.");

and also make sure that Line No. filter is right..

ReqLineL.SETRANGE("Line No.",PurchaseLine."Line No.");??

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Wed Apr 11, 2012 12:31 pm 
Offline

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

Yes Requisition Line record variable for my customised form.

I made a mistake while pasting the codes here. Its Document No. not No. on Purchase Line.

But its not working at all.
The fields on my customised form is not being refreshed after posting a Purchase Order(Form 50).

Plz help...

Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Wed Apr 11, 2012 12:44 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
Where did you write your code to update the lines while posting?

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Thu Apr 12, 2012 7:03 am 
Offline

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

I have written the code in a codeunit and I have called it on the Post button of my customised form.

Thanks

Liizz


Top
 Profile E-mail  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Thu Apr 12, 2012 7:12 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
You want to insert/update the line in your customized form (requision line) each time whenever user insert/modify Qty to receive in form50..

You have written code and calling the same in Customized form..is it?
you have to run the function from customized form each time manually to update the changes..

Is that your whole code? with that code you cant achieve what you want..

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Thu Apr 12, 2012 7:34 am 
Offline

Joined: Thu Dec 16, 2010 8:11 am
Posts: 97
Country: Bangladesh (bd)
Yes this is my code to do this. I want to update lines on customised form each time the field Qty. to Receive is modified on form 50.

But how to I update the lines in the form.

Please advise.


Top
 Profile E-mail  
 
 Post subject: Re: Update fields on a Purchase Order
PostPosted: Thu Apr 12, 2012 7:42 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4224
Location: New Delhi
Country: India (in)
You can call the above code in OnValidate trigger of Qty received in Table 37-Sales Line

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
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 11 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: