Page 1 of 1

Custom lookup for Brach

PostPosted: Mon Aug 24, 2020 10:51 am
by DannyC
I have a custom field on debtors which is a lookup to branch.This code worked fine in 7.0.175
Code: Select all
    Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ButtonClicked
      ' Search   
      If CustomField.PluginCustomField.Name = "SalesDivision" Then
         Dim branch As New JiwaApplication.Entities.Sales.Branch
         branch.Search(FormObject.Form, "")
         CustomFieldValue.Contents = branch.Description       
         CustomFieldValue.DisplayContents = branch.Description          
      End If
    End Sub

but it doesn't work in 7.2.1. No error, it just doesn't display the search window when the buttonclick is clicked.

What the trick to getting it to to display in 7.2.1? Yep - in VB!

Re: Custom lookup for Brach  Topic is solved

PostPosted: Mon Aug 24, 2020 10:54 am
by Mike.Sheen
Code: Select all
Dim branch As New JiwaApplication.Entities.Sales.Branch


This isn't using the factory to create the entity. Use the factory!

Re: Custom lookup for Brach

PostPosted: Mon Aug 24, 2020 11:15 am
by DannyC
Awesome!
All sorted.