Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

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

Posted on by Microsoft Employee

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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans