Re: [development-axapta] Setting field to mandatory via code

2010-04-19 Thread avi's
hi,

im new to DAX n learning i've installed ax 5.0 and done with all checklist 
items but one problem is tht coulnd able to see any of the modules including 
admin,navigation pane is disabled ,please help me

thnks

avinash

--- On Thu, 15/4/10, Anitha Santosh  wrote:

From: Anitha Santosh 
Subject: Re: [development-axapta] Setting field to mandatory via code
To: development-axapta@yahoogroups.com
Date: Thursday, 15 April, 2010, 1:06 PM







 



  



  
  
  hi,

try this in active method of the Datasource:



dimension1.mandator y(true);



hope it works...



On Thu, Apr 15, 2010 at 11:04 AM, www_programmer

wrote:



>

>

> I have a formcontrol combobox that allows you to select from

> ledgerJournalTrans. Dimension. The three dimensions from the Enum are

> displayed on the form at textboxes inside of a group. They were placed on

> the form as a fieldgroup.

>

> I have set the AutoDeclaration to Yes for all of them. They have the names:

> Dimension1, Dimension2 & Dimension3 in their control properties.

>

> When I go to set the mandatory settings directly in their form properties,

> I get the expected red wavey line. But when I try to set it in code, which

> is what I want to do, I don't get the option to set the property mandatory.

>

> I try this code:

> element.control( Control:: Dimension1) .

>

> But, .mandatory(true) is not an option. If I try

> element.control( Control:: Dimension1) .visible( false);

> The correct element will be invisible. So, I'm not sure why I can't set

> mandatory.

>

> Thanks for the help.

>

> 

>



[Non-text portions of this message have been removed]






 





 



  







[Non-text portions of this message have been removed]



Re: [development-axapta] Setting field to mandatory via code

2010-04-15 Thread Anitha Santosh
hi,
try this in active method of the Datasource:

dimension1.mandatory(true);

hope it works...

On Thu, Apr 15, 2010 at 11:04 AM, www_programmer
wrote:

>
>
> I have a formcontrol combobox that allows you to select from
> ledgerJournalTrans.Dimension. The three dimensions from the Enum are
> displayed on the form at textboxes inside of a group. They were placed on
> the form as a fieldgroup.
>
> I have set the AutoDeclaration to Yes for all of them. They have the names:
> Dimension1, Dimension2 & Dimension3 in their control properties.
>
> When I go to set the mandatory settings directly in their form properties,
> I get the expected red wavey line. But when I try to set it in code, which
> is what I want to do, I don't get the option to set the property mandatory.
>
> I try this code:
> element.control(Control::Dimension1).
>
> But, .mandatory(true) is not an option. If I try
> element.control(Control::Dimension1).visible(false);
> The correct element will be invisible. So, I'm not sure why I can't set
> mandatory.
>
> Thanks for the help.
>
> 
>


[Non-text portions of this message have been removed]



Re: [development-axapta] Setting field to mandatory via code

2010-04-15 Thread Tom Kim
I believe you want to do something like this:

ledgerJournalTrans_DS.object(fieldId2Ext(fieldNum(LedgerJournalTrans,Dimension),1)).mandatory(true);

I haven't tested this code, but it should be very close to this. The second 
parameter allows you the specify the array index for the Dimension field, or 
any field that's an array field. If you want to evalutate whether the field(s) 
should be mandatory on a record-by-record basis, then put the code in the 
"active" method of the LedgerJournalTrans data source.

Hope this helps. --Tom



On Apr 15, 2010, www_programmer  wrote: 

  I have a formcontrol combobox that allows you to select from 
ledgerJournalTrans.Dimension. The three dimensions from the Enum are displayed 
on the form at textboxes inside of a group. They were placed on the form as a 
fieldgroup.

I have set the AutoDeclaration to Yes for all of them. They have the names: 
Dimension1, Dimension2 & Dimension3 in their control properties.

When I go to set the mandatory settings directly in their form properties, I 
get the expected red wavey line. But when I try to set it in code, which is 
what I want to do, I don't get the option to set the property mandatory.

I try this code:
element.control(Control::Dimension1).

But, .mandatory(true) is not an option. If I try 
element.control(Control::Dimension1).visible(false);
The correct element will be invisible. So, I'm not sure why I can't set 
mandatory.

Thanks for the help.