Page 1 of 1

Lookup custom field select issue

PostPosted: Thu Dec 09, 2021 1:35 pm
by Riyaz
Hi There

We have a strange issue with lookup custom field on PO lines, whenever a value is selected from the lookup its not shown in the custom field dropdown, but when you save the PO or click somewhere else from the dropdown it shows the value chosen. Please see the attached plugin and kindly guide us here. Thanks

Re: Lookup custom field select issue

PostPosted: Thu Dec 09, 2021 2:22 pm
by SBarnes
On setting a system setting I do the code below, I am pretty sure the custom field works in the same way that you need to set the display value as well as the contents when you change it, your code is only changing the contents.


Code: Select all
      if (SystemSetting.IDKey == "ImportDir" )
      {
         using(var fbd = new System.Windows.Forms.FolderBrowserDialog())
         {
             DialogResult result = fbd.ShowDialog();

             if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
             {
                 SystemSetting.DisplayContents = fbd.SelectedPath;
                SystemSetting.Contents = fbd.SelectedPath;
                
             }
         }
         
         
         
         
      }

Re: Lookup custom field select issue

PostPosted: Thu Dec 09, 2021 3:29 pm
by Riyaz
Hi Stuart

Thanks I had already tried that with no luck, even with CustomFieldValue.RecID

Re: Lookup custom field select issue

PostPosted: Fri Dec 10, 2021 4:06 pm
by Riyaz
Hi There

Need some guidance with this please

Re: Lookup custom field select issue  Topic is solved

PostPosted: Tue Dec 14, 2021 3:10 pm
by Mike.Sheen
Looks like a bug.

Logged as DEV-9093 - as a work-around you can just manually set the grid cell text yourself within the ButtonClicked method in the LineCustomFieldPlugin class.

Re: Lookup custom field select issue

PostPosted: Tue Dec 14, 2021 7:45 pm
by Riyaz
Hi Mike

Thanks for the work around, I tried but get concurrency conflict error, pls see the error and the plugin attached FYI

Re: Lookup custom field select issue

PostPosted: Wed Dec 15, 2021 12:16 pm
by Mike.Sheen
That error is not related - it's because you added this line:

Code: Select all
CustomFieldValue.RecID=.Fields(2).FieldValue & " - " & .Fields(3).FieldValue


Don't do that!

Remove that line and the error no longer occurs.

Re: Lookup custom field select issue

PostPosted: Thu Dec 16, 2021 12:35 pm
by Riyaz
Thanks Mike