How to customize the fields or tabs in forms company wise in AX 2012?

Hi,

I am creating a new tab and it contains fields in Quality order form in AX 2012. I want to hide this tab in one company. and the fields also hide in some companies. How to do this Please help me.

Thanks,

Balu

Set AutoDeclaration property to Yes for that tab and in active method of the form you can write your query as :

if (curext() == “CEU”)

{

tab.visible(false);

}

else

{

tab.visible(true);

}
And remember to set the visible property of the tab to ‘No’ .

In a multi-company environment it would make more sense to parameterise it.

Hi Vishal,

Thanks for giving suggestion, Its working for only Tab, but I am trying to hide the Fields, I follwed the same for fields its not working.

Thanks,

Balu

it should work for field also…

what code you have writen and where? can you share the code which you have written?

you can try the following way also. write the code in your init mathod of the form. as shown below.

if(salesTable.dataAreaId == ‘DAT’)

{

salesTable_ds.object(fieldnum(SalesTable,SalesQuotationType)).visible(TRUE);

}

else

{

salesTable_ds.object(fieldnum(SalesTable,SalesQuotationType)).visible(false);

}

Ya I know it should work, thats why i am applying the same code for field, Ok I share my code.

Set AutoDeclaration property to Yes for that Field and in active method of the form :

if(curext() == “1100”)

{

ForecastSales_SalesAgreement.visible(false);

}

else

{

ForecastSales_SalesAgreement.visible(true);

}

and visible property of this field is set to “no”, but its not working

Thanks,
Balu

what ever, you just try my code which i shared above. for this code you no need to set Autodeclaration property.

just try it and let me know…

Hi Ven,

Thank u so much, The code which u have given, Its working fine.

Thanks,

Balu