This is my first post to a forum on mibuso, although I've searched for answers on here before with great success. Couldn't see anything already posted on my query, so here goes.
I am using Navision V4.0 SP3.
Can anyone please tell me if the use of Purchase Orders can be restricted to only being able to be created by using the Requisition Worksheet first. The Requisition Worksheet as I understand it will order for all demand on SMO's not yet met and for Inventory to set levels according to the ReOrder Policy set.
What I'm basically trying to acheive here is to block the manual population of Items on a Purchase Order. Purchasing to the G/L, Resources, etc can still happen, just not Items.
Thanks
P
Comments
You could use the function "UpdateEditable" on the Qty field of Purchase Documents when the line type is an item.
This then means the whole posting process and code validation in NAV is left untouched.
However, watch for Item Jnl Line and -ve Qty lines in Sales Orders, and other crafty ways users would get around what you have implemented.
And with this kind of thing I always tend to make it a boolean setup field, just so that when that one day comes and you need to set an Item in a P/doc you can un tick the setup field and don't have to fiddle with code.
T
Can ask you a question?
"You could use the function "UpdateEditable" on the Qty field of Purchase Documents when the line type is an item.
"
Where is the function "updateeditable"? I can't find out it.
From the help file :
Dynamically changes the setting of the Editable Property property of a field, form, or control.
UPDATEEDITABLE(Editable)
Parameters
Editable
Type: Boolean
Possible values are true and false. If the value is true, the control will be changed to editable. If the value is false, the control will be changed to not editable.
Remarks
This function can only be called from the OnBeforeInput Trigger of the control. The property will only be changed temporarily, that is, for the duration of this form.
Example
In this example, you use this function to set the Editable Property property of a control dynamically, based on, for example, the current value of another field.
IF "On Hold" THEN
CurrForm.Address.UPDATEEDITABLE(FALSE);
T
Thanks for your reply.
I've tried to use help f1 to read up on UpdateEditable, though like zuihua, no topic was found.
Can you provide anything further
P
Are you in the Dev environment when you press F1?
Basically what it does is allows you to set if a field is editable or not "as the user clicks it" If that makes sense?
You add it to the OnBeforeInput trigger on the form, field "quantity"
Create a new form.
two variables, one a boolean call it "checked" and the other a code field L20 called, er, "code" I suppose
Add controls to the forms and set SourceExpr to the variables as above. (one boolean, one textbox)
Make sure you know the "name" property of the textbox you put on the form lets call it "name"
On the OnBeforeInput trigger of Name add the code
currform.name.updateeditable(checked);
Then try combinations of having the boolean checked and not, and trying to edit what is in the "name" field.
hope that makes sense
T
i'll give it a go.
you guys on this forum are god-like
cheers
P
=D>