I would like to create a dropdown in AX form so that only the user from specific company see this field as a dropdown and other company see it as string field that user have to manually key in. I only manage to create the dropdown list based on table menu, but have no idea how to limit to specific company.
This create a problem since not all company wants dropdown and If the user key in none registered number, the system will return “ the value xxx in the field yyy is not found in the relating table zzz
How can I set the condition so that only selected company see this field as dropdown and the other company see this as string? And also where to locate the condition?
You may need to set the form control property
AutoDeclaration=Yesand then dynamically change theFormStringControl.LookupButton(see here) based on the current company (curext()).You must also decide if you have a relation on your table, whether or not you want it to be enforced (
Validate=[Yes/No]). If you are allowing a free-text field input, I would imagine you would wantNo, but you could perform validation in thevalidateFieldorvalidateWritemethod.Depending on your situation, you may want to create a custom
lookupwith a condition.See how to create custom lookups here - https://learn.microsoft.com/en-us/dynamicsax-2012/developer/how-to-add-a-lookup-form-to-a-control
You'll have to experiment a little, but this information should point you the right direction.