Skip to main content

Posts

Showing posts with the label event handler

Resolve "More Than One Form Was Opened at Once for the Lookup Control" Error

While overriding lookup method on  form data source's field it COC is not working for most of the case so everybody is looking after event handlers. But there is one problem in case of that after writing code for event handler its throwing error as "More Than One Form Was Opened at Once for the Lookup Control" as you can see in following screenshot. To resolve this we need to cancel super call to lookup method which is fairly easy to acheive you just need to add following two lines of code in such case  1 2 3 // Cancel the super call of lookup control. FormControlCancelableSuperEventArgs formControlCancelSuper = e as FormControlCancelableSuperEventArgs; formControlCancelSuper.CancelSuperCall(); for example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [FormControlEventHandler(formControlStr(PurchTable, ContactInfo_Email), FormControlEventType::Lookup)] public static void ContactInfo_Email_On...

How to disable particular Financial Dimension on Desired form

Sometimes we want to disable particular financial dimension for purchase requisition line or any other form. To achieve that we need to write code on OnInitialized event handler of the required form. please follow the steps to achieve this functionality. Go to desired form and make note of control that is used for financial dimension(in our case Purchtable form and DimensionEntryControlLine control name). Now go to desired form(Purchtable in our case) and select OnInitialized event handler as follows and paste it in your class. write following code in the event handler class and provide Name field value (dimension which should be disabled) as well as DimensionEntryControl name and build the project. code :- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 class PurchTableEventHandler { /// <summary> /// /// </summary> /// <param name="sender"></param> /// <para...