Advertisement
Guest User

form load

a guest
Apr 5th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. public void FormLoad()
  2.         {
  3.             _formLoaded = false; // otherwise method gets called recursively for some reason
  4.             try
  5.             {
  6.                 if (_form.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE)
  7.                 {
  8.                     string id = _form.UniqueID;
  9.                     //edit text to enter code, this line may throw COM exceptions about the cast, seemingly randomly
  10.  
  11.                     SAPbouiCOM.BoFormItemTypes t = _form.Items.Item("5").Type;
  12.                     _ET_codeEntry = (SAPbouiCOM.EditText)(_form.Items.Item("5").Specific);
  13.  
  14.                     _CoB_codeEntryMode = (SAPbouiCOM.ComboBox)(_form.Items.Item("1320002080").Specific);
  15.  
  16.                     //get new code automatically
  17.                     newCode = NumberPool.GetNextNumber("BUSPARTNER");
  18.  
  19.                     _ET_codeEntry.Value = newCode.ToString();
  20.  
  21.                     //deactivate items
  22.                     _ET_codeEntry.Active = false;
  23.                     _form.Items.Item("5").Enabled = false;
  24.                     _form.Items.Item("1320002080").Enabled = false;
  25.  
  26.                     _CoB_codeEntryMode.Active = false;
  27.                     _CoB_codeEntryMode.ValidValues.Add("0", "Automatisch");
  28.                     //_CoB_codeEntryMode.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index);
  29.                     //_CoB_codeEntryMode.Select("Automatisch", SAPbouiCOM.BoSearchKey.psk_ByDescription);
  30.                 }
  31.             }
  32.             catch (Exception ex)
  33.             {
  34.                 _log.Add("FormLoad() exception: " + ex.Message);
  35.                 //WriteLog();
  36.             }
  37.  
  38.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement