Notifications
Announcements
No record found.
Hello every one i need to set adefault value to the for when init it i'm trying to write this code prodParmReportFinished.Unit="50"; in init value method but not working
*This post is locked for comments
Hi Ahmed,
Check if the unit field has a relation with the Units of measurement table. If so, check if the value '50' is setup. Can you also elaborate on the exact code used? Do you have compilation errors, runtime errors or is it just not working?
Hi André
the field is a string field and there is no relation the field name is just a description
here is the code
What do you mean by "not working"? Some error? Not the expected value? Something else? We don't like to guess :)
i mean that the value didn't implemented (the field stile empty )
Did you debug it? Does the initValue method get called? Does some other method (executed later) perhaps overwrite that value?
Is "50" a unit of measure? Usually it is a quantity and unit of measure might be created like "box 50" if there needs to be a conversion from pieces to packed boxes.
Your should overwrite the write method not initValue method
public void write()
{
super();
prodParmReportFinished.Unit="50"
}
Write method is called when the record is saved, so it can't be used to initialize default values. InitValue is used for the purpose.
And if you set some value in write method after super(), it won't be even written to the table.
no it is not a measure it just a description it could be "N50"
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2