CurrForm.EDITABLE

MehdiMehdi Member Posts: 16
Hi Guys,
My Client wants a control in the Sales Order Subform F46, which consist in:
If = Item : Editable is set to No for Description
Ii <> Item : Editable is set to Yes for Description.

I've put the code below in Form.OnAfterGetRecord
IF Type=Type::Item THEN
    CurrForm.Description.EDITABLE(FALSE)
ELSE
    CurrForm.Description.EDITABLE(TRUE);

The problem is that this code take effect only when the current line is insered in the table:
Suppose that the Type of the first line is set to Blank, when we create a second line with a type of Item, this code did not take effect, so obviously the the CurrForm.Description.EDITABLE is set to TRUE (it take the Type value of the previous line)

What's the solution...??
Thanks for your help.

Comments

  • MBergerMBerger Member Posts: 413
    I think that's because the record hasn't been inserted yet, so the OnAfterGetRecord() trigget hasn't been fired for that record yet,
  • kapamaroukapamarou Member Posts: 1,152
    Examine the difference between OnAfterGetRecord and OnAfterGetCurrentRecord. (You can add a different message in each trigger and see the behavior).
  • BeliasBelias Member Posts: 2,998
    Try to put the code in onvalidate of the "type"... (onvalidate of the form, obvoiusly)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • MehdiMehdi Member Posts: 16
    I've tried to put the code in both OnAfterGetCurrRecord & OnValidate (Type) but nothing change.
    Thanks for your Help
  • vijay_gvijay_g Member Posts: 884
    Mehdi wrote:
    I've tried to put the code in both OnAfterGetCurrRecord & OnValidate (Type) but nothing change.
    Thanks for your Help

    i have checked it it's working fine. put your code in both trigger.
  • kapamaroukapamarou Member Posts: 1,152
    Check also if you have more than one textboxes named Description.
  • MehdiMehdi Member Posts: 16
    It's works, Thanks for your help :)
Sign In or Register to comment.