Hello all,
I've attempted this a number of different ways with no success...
When a user selects 'Resource' as Type in the Sales Order Subform, I'd like the Quantity for that line and that line only to default to 1.
I don't know if my issue is in syntax or placement...any suggestions/samples would be much appreciated!
I'm a newbie but for every 3, 4 issues I figure out there is one that I get stuck with, and this is one. Thanks! Chris
0
Answers
you can add code to the "Sales Line" table, to the Type - OnValidate trigger, something like this:
Is there a reason you prefer the form?
http://www.BiloBeauty.com
http://www.autismspeaks.org
You should never put processing code on a form, always in a table or codeunit.
In regards to the 'preference' inquiry, no preference, I'm just new. Thanks - Chris
Shouldn't I now see a '1' in the Quantity field? It's still blank...
I want quantity to be editable, just only to default to '1' when a Type of 'Resource' is selected.
Suggestions? Thanks - CDM
I don't use resoucre ever as a type - so I haven't tested it but we do have all our sales lines default to 1 regardless of the type.
Where are you putting the code & are you making a sales order or a sales invoice?
Maybe try something like this....
No. - OnValidate()
IF Type IN [Type::Item,Type::Resource] THEN
VALIDATE(Quantityty,1)
ELSE
VALIDATE(Quantity);
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org