Skip to main content
Answer

Issue with Graph.Document.Search on SOOrderEntry returning null

  • September 12, 2024
  • 3 replies
  • 40 views

Forum|alt.badge.img

Hello community. Working through a customization project and I am having issues locating an SO using a search in a custom processing screen. In my code below my primary DAC is SOLine. I am using values from there in a foreach statement to then load the SO in an SOOrderEntry graph. However, it is not returning the SO record. Is there a better way to go about this code? The code returns “Object reference not set to an instance of an object” on the final line below when testing.  

Thanks,

Adam

Best answer by Django

This one catches us all.

One option is to use FK.Find to locate the order. The other option to continue to use search means that you need to set up your search very slightly differently.

The thread, below, outlines what @darylbowman documented when trying to sort this out. There’s comment in the thread that gives the reason why.

 

3 replies

Forum|alt.badge.img+7
  • Captain II
  • Answer
  • September 12, 2024

This one catches us all.

One option is to use FK.Find to locate the order. The other option to continue to use search means that you need to set up your search very slightly differently.

The thread, below, outlines what @darylbowman documented when trying to sort this out. There’s comment in the thread that gives the reason why.

 


darylbowman
Captain II
Forum|alt.badge.img+15

Easiest way to use Search<> is to search the source code for the same use-case (same entity), because they differ depending upon how the Data View is written.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • September 12, 2024

@Django Perfect thanks! Learning a ton with the community's help. Greatly appreciated!