SmartBusinessEntityLookup
 
Forums / SmartComponent Library - Developer Forum / SmartBusinessEntityLookup

SmartBusinessEntityLookup

5 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    22 Apr 2020
    Link to this post
    I have read the "Using the SmartBusinessEntityLookup Control" 20 times and I must be missing something.

    I have a lookup control and it works when selecting a record from the dialog.

    I have added a second button on the control to allow me to "clear" the control. When I use this editor button the value is cleared on the screen but no in the database.

    I then did not use the clear editor button and just manually cleared out the text in the control. When I save the first character of the previous value is saved into the database. For example, the previous value was 4000 so 4 was saved into the database. If the value was 1000 then 1 was saved into the DB.

    Now, the data type of this field in the DB is a DECIMAL and the lookup control is an UltraTextEditor. I am not sure if that is related or not but I am at a point to move to the smartcomboeditor even though I may have 1000 entries in it.

    Any ideas?
  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    22 Apr 2020 in reply to Roger Blanchard
    Link to this post
    Please share the properties of the lookup from the InitializeComponent method of the Viewer.
  3. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    22 Apr 2020 in reply to Mike Fechner
    Link to this post
    I have tried setting the LookupTimerDisabled = TRUE no luck. 


    /*  */
      /* smartBusinessEntityLookup1 */
      /*  */
      THIS-OBJECT:smartBusinessEntityLookup1:AppServerPartition = "".
      editorButton3:Key = "ShowLookupDialog".
      editorButton3:Text = "...".
      THIS-OBJECT:smartBusinessEntityLookup1:ButtonsRight:Add(editorButton3).
      THIS-OBJECT:smartBusinessEntityLookup1:CausesValidation = FALSE.
      THIS-OBJECT:smartBusinessEntityLookup1:DataBindings:Add(NEW System.Windows.Forms.Binding("Value", THIS-OBJECT:StoreBindingSource, "VendorNum", TRUE)).
      THIS-OBJECT:smartBusinessEntityLookup1:Location = NEW System.Drawing.Point(503, 390).
      THIS-OBJECT:smartBusinessEntityLookup1:LookupAdditionalFields = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupBrowserExcludeFields = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupBrowserFields = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupCascade = FALSE.
      THIS-OBJECT:smartBusinessEntityLookup1:LookupControls = "eStore_Vendor_Name".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogClassName = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogExpandLastColumn = TRUE.
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogFilterFields = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogFilterOperators = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogOpenQuery = TRUE.
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogQuerySort = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogQueryString = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogTitle = "Lookup".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupDialogTranslationScope = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupEntityName = "Osprey.Host.Vendor.VendorBusinessEntity".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupEntityTable = "eVendor".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupEntityView = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupFields = "Name".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupKeyField = "VendorNum".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupKeyValue = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupKeyValueColumn = "VendorNum".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupQuerySort = "".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupQueryString = "FOR EACH eVendor WHERE eVendor.VendorNum = ~"&1~"".
      THIS-OBJECT:smartBusinessEntityLookup1:LookupTimerDelay = 750.
      THIS-OBJECT:smartBusinessEntityLookup1:LookupTimerDisabled = TRUE.
      THIS-OBJECT:smartBusinessEntityLookup1:Name = "smartBusinessEntityLookup1".
      THIS-OBJECT:smartBusinessEntityLookup1:Nullable = FALSE.
      THIS-OBJECT:smartBusinessEntityLookup1:OwningGrid = ?.
      THIS-OBJECT:smartBusinessEntityLookup1:Size = NEW System.Drawing.Size(163, 21).
      THIS-OBJECT:smartBusinessEntityLookup1:SpinThroughPartialMatches = FALSE.
      THIS-OBJECT:smartBusinessEntityLookup1:TabIndex = 80.
  4. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    22 Apr 2020 in reply to Roger Blanchard
    Link to this post
    I added the message below. When I use the perform lookup in the BE lookup control the BeforeAssignRecord will have the before value and the AfterAssignRecord will have the new value.

    When I clear the value of the lookup control the BeforeAssignRecord will have the before value and the AfterAssignRecord will have just one character with it being the first character of the before value

    /*------------------------------------------------------------------------------
      Purpose:
      Notes:
     ------------------------------------------------------------------------------*/
     @VisualDesigner.
     METHOD PRIVATE VOID StoreAdapter_AfterAssignRecord( INPUT sender AS System.Object, INPUT e AS Consultingwerk.SmartComponents.Implementation.AfterAssignRecordEventArgs ):
      
      MESSAGE
       "afterassignrecord"  SKIP
       e:BufferHandle:buffer-field ("VendorNum"):BUFFER-VALUE
      VIEW-AS ALERT-BOX.
      
      RETURN.
     END METHOD.
     /*------------------------------------------------------------------------------
      Purpose:
      Notes:
     ------------------------------------------------------------------------------*/
     @VisualDesigner.
     METHOD PRIVATE VOID StoreAdapter_BeforeAssignRecord( INPUT sender AS System.Object, INPUT e AS Consultingwerk.SmartComponents.Implementation.BeforeAssignRecordEventArgs ):
      
      MESSAGE
       "BeforeAssignRecord"  SKIP
       e:BufferHandle:BUFFER-FIELD ("VendorNum"):BUFFER-VALUE
      
      VIEW-AS ALERT-BOX.
      
      RETURN.
     END METHOD.
  5. Roger Blanchard
    Roger Blanchard avatar
    381 posts
    Registered:
    29 Jun 2018
    22 Apr 2020 in reply to Roger Blanchard
    Link to this post
    It appears the bindingsource input value is incorrect.

    In looking at UpdateRow in Consultingwerk.SmartComponents.Base.SmartDatasetAdapter where the buffer fields are being assigned. the input value is incorrect.
5 posts, 0 answered