Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

A new Field on the location Form should be only enableable with a specific location type ?

Posted on by

Hi All 

on WHSLocation Form I have added a new FormCehckBoxControl and the requirment is : 

  • The new Field on the location Form should be only enableable for locations with a specific location type 
  • Determine specific location type 
  • Location => location profile => location type = warehouse management parameter => packing location type 

tha'ts meaning  if the WSHLocationProfile.LocType == 'VPG' then should be the checkbox true and the rest false 

What i have treid until now but i can't go forward thus i need help please 

[FormDataSourceEventHandler(formDataSourceStr(WHSLocation, WMSLocation), FormDataSourceEventType::Initialized)]
public static void WHSLocation_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
{
WMSLocation wMSLocation = sender.cursor();
FormDataSource formDataSource = sender.formRun().dataSource('WMSLocation');
FormRun element = sender.formRun();
FormCheckBoxControl disableLicensPlate;

disableLicensPlate= element.design(0).controlName("WHSLocation_DisableLicensPlate");

WHSLOCATIONPROFILE wshLocationProfile;
WHSLOCATIONTYPE wshLocationType;

while select wshLocationProfile

{
if(wshLocationProfile.LocType == 'VPG')
{
disableLicensPlate.allowEdit(true);

}
else
{
disableLicensPlate.allowEdit(false);
}

}

}

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,165 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans