formlookup custmization of a form field.

Hi all,

I am new in ax 2012 , i have requirement to customize a lookup in customer form.

when i am creating a new customer then what is the name of form lookup that open in name lookup . i need name lookup filter based on roles that means all names come except name with worker roles . i am tried many stuff but cant find right solution.

i don’t know which form lookup is open in name lookup and where i have to make changes .

please suggest me how to get the right solution and where i have to make customization.

thank you

You can start looking at the lookup method of the form data source control.

\Forms\DirPartyQuickCreateForm\Data Sources\DirPartyTable\Fields\Name\Methods\lookup

In that there is a call,

DirUtility::namelookup(_formControl, dirPartyTable, DirPartyType::Organization, element);

Look at the last parameter of the nameLookup method, it is basically used to apply the filter on the different entities.

Hi Kranthi thanks for your reply.

as per my understanding in name field lookup dirpartytablelookup form is open and in that lookupform data source dirpartyview is used and i have to make customization there .

as per your answer what value i have to pass at place of element.

DirUtility::namelookup(_formControl, dirPartyTable, DirPartyType::Organization, element);

please tell me in details of your option so i can try.

can i do it without any code using range in query ??

Thanks again.

Yes.(look at \Forms\AuditPolicyRule\Data Sources\AuditPolicyListParty\Fields\Party\Methods\lookupReference)

And you should be able to restrict the changes only as per your requirement, as the form is used for the creation of other parties.

Hi Kranthi.

i am tried to write a a method on data source

public void init()
{
QueryBuildDataSource qbds;
super();
qbds = this.query().dataSourceTable(tableNum(DirPartyView));
qbds.addRange(fieldNum(DirPartyView, RoleType)).value(queryValue(DirPartyRoleType::Worker));

}

i am getting all name without filter

if possible please give me more detail how to do it by your process i am tried all possible way that i am think but not get right solution.

thank you again

Have you looked at the told example?

Hi Kranthi ,

till now i am not completed that task due to some other work because i have to give some time on that .

ASAP my work is done i am again start working on that task .

Thanks again.