Skip to main content

Notifications

Announcements

No record found.

Customer Service forum

How to Re-Initialize the Global variable Control

Posted on by Microsoft Employee

My Requirement is need to be show/hide Purpose list in the lookup based on the master type(Customer, Vendor ) during adding the address details for the customer / vendors.

For customers need to show certain Purpose details list and Vendors need to show certain list.

So i have modified as mentioned below : 

In logistics postal address form, init method assign the purpose string control value. 

Like: rolesCtrl = SysLookupMultiSelectCtrl::construct(element, roles, queryStr(LogisticsLocationRolePostalLookup), true, [tableNum(LogisticsLocationRoleTranslation), fieldNum(LogisticsLocationRoleTranslation, Description)]);

I cannot go for Event handler, because I cant get/access the "rolesCtrl"  global variable. 

But in COC(Extension) am using custom query(XXXLogisticsLocationRolePostalLookup) like:

public void init()
{
next init();
this.rolesCtrl = SysLookupMultiSelectCtrl::construct(this, roles, queryStr(UseLogisticsLocationRolePostalLookup), true, [tableNum(LogisticsLocationRoleTranslation), fieldNum(LogisticsLocationRoleTranslation, Description)]);
}

am getting error: A control with the name 'Roles_Ids' already exists on the form.

Please advise How to do?

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.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans