Wednesday, January 11, 2012

How TO Write an Edit Method

Question:
How to write an edit method?


Answer:
Suppose you have an integer field with allowed values of 0 and 1. We can use an edit method to show a check box instead. We just have to use this edit method as a display method on the form control.


public edit NoYesId IsAllowed(boolean _set, NoYesId _value)
{
    NoYesId ret;
    int actualValue;
    if (_set)
    {
        if(_value == NoYes::Yes)
        {
            actualValue = 1;
        }
        ttsbegin;
        this.IsAllowedInt = actualValue;
        this.update();
        ttscommit;
    }
    else
    {
        if(this.IsAllowedInt)
        {
            ret = NoYes::Yes;
        }
    }
    return ret;
}

8 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. With the release of Microsoft outlook 2010 download, you get a richer set of experiences to meet your communication needs at work, home, and school. Enjoy the freedom of using Office Standard 2010 from more locations on more devices.

    ReplyDelete
  3. Microsoft Dynamics AX training, do keep a few things in mind to get the maximum out of the course as well as the application.we teach Microsoft Dynamics AX training and class at Hyderabad.Microsoft Dynamics CRM training in Hyderabad

    ReplyDelete
  4. Microsoft Dynamics CRM training will help you manage and prioritize your business goals, customize.we teach MS Dynamics CRM training and class available at Hyderabad.Microsoft Dynamics CRM training in Hyderabad, Microsoft Dynamics NAV training in Hyderabad

    ReplyDelete
  5. Microsoft Dynamics NAV training could be a lifelong asset for your role in a small or medium enterprise.NAV Technical, NAV Trade, NAV Finance.we teach Microsoft Dynamics NAV training and class available at Hyderabad. Microsoft Dynamics CRM training in Hyderabad, Microsoft Dynamics NAV training in Hyderabad

    ReplyDelete
  6. Your information is really useful and interesting.Thanks for sharing.We are also giving all software Course Online Training.The oracle Online Training is one of the leading Online Training institute in the world.
    Oracle fusion financials training

    ReplyDelete