I have a form called Purchase Quote. Within the form I have a subfrom. Form gets it data from Purchase Header table and subfrom gets it data from Purchase Line table.
The subform contains following fields: TYPE (option: G/L Entry, Fixed Assets, Item, Charge), Cost Center Code (Code 20), No. (code 20).
So basically, if the No. Field in the form begins with RF******, I need the Type ---> G/L Entry, Item and Charge greyed out and Fixed Asset to be automatically selected (in the subform).
I am not sure How to do this. The form and subform are linked by the No. Fields.
0
Answers
You do realize Purchase Quotes is standard Nav. You make it sound like it's some creation you made?
Are you trying to mimic it in your own "new form"?
Have you ever seen options "Grayed Out" in Nav?
This is something you have to add to the code on the Purchase line table on validate of the "No.".
to perhaps show an error message if a certain type isn't being used.
If you look at the code you will see how it handles different TYPE's.
This almost sounds like your going the route of hardcoding "RF" stuff.
Hardcoding is never a good idea. Try to rethink the solution.
Just because it's needed today doesn't mean it will be needed down the road.
Just train the users to do it correctly.
Here's a perfect example:
viewtopic.php?f=23&t=52376
he had to find in the code somewhere where "2" was used. Probably what they wanted at some point but things change and any changes you make should be accessible in a setup table somewhere incase the need changes in the future.
http://www.BiloBeauty.com
http://www.autismspeaks.org
On your subform you could have
Form - OnAfterGetCurrRecord()
IF "No." = 'RF******' then
CurrForm.Type.editable (false)
else
CurrForm.Type.editable (True);
CurrForm.UPDATECONTROLS;
and on your Purchase Line table
No. - OnValidate()
if "No." = 'RF******' then
Type := Type::"Fixed Asset";
Good luck
Until next time
That's is how they want to differentiate between there records. Thats what I will give them because thats what my manager wanted.
Until next time