0

We created a custom object. (For reference purposes, let's call it ObjectA)

We included that Custom object on the Purchase Orders (as a grid) but when including the Key(OrderNbr) on the grid itself, it only appears as a plain text field.

I'm a little ignorant as to what to include (just because I don't know what dictates the link being created.) For starters, I'm going to include the field itself.

#region OrderNbr     
public abstract class orderNbr : IBqlField { }
protected string _OrderNbr;
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXDefault()]
[ObjectA(typeof(Search<ObjectA.orderNbr, 
    Where<ObjectA.orderNbr, Equal<Optional<ObjectA.orderNbr>>>>), Filterable = true)]
[PXUIField(DisplayName = "ObjectA Nbr.", Visibility = PXUIVisibility.SelectorVisible)]              
[PXSelector(
    typeof(Search<ObjectA.orderNbr>),
    typeof(ObjectA.orderNbr),
    typeof(ObjectA.createdDateTime),
    typeof(ObjectA.status), Filterable = true)]
[AutoNumber(typeof(IOOASetup.objectnumseqid), typeof(ObjectA.createdDateTime))]

public virtual string OrderNbr
{
    get
    {
        return this._OrderNbr;
    }
    set
    {
        this._OrderNbr = value;
    }
}
#endregion

We ultimately want the OrderNbr to be a clickable link to a Graph.

I created, also, a custom Attribute for ObjectA with the extension of PXSelectorAttribute

Kyle S
  • 132
  • 8
  • 1
    There are 2 options and both are answered in this similar question: https://stackoverflow.com/questions/26387291/how-to-create-a-hyperlink-user-field/26439423#26439423 Try the recommendations and update your answer with any issues you are running into. The simple solution is to use the Allow Edit on the field in the page and set a primary graph on your DAC. – Brendan Feb 08 '18 at 21:15
  • You would even do this for the key of the object itself? Just because these callbacks are dependent on a Grid. – Kyle S Feb 08 '18 at 21:24
  • 1
    yes its the same for grid or form. You can compare to POOrder which uses PXPrimaryGraph POOrderEntry. Then when POOrder is in a selector for OrderNbr and the field has AllowEdit = true the hyper link has what it needs from the primary graph to open and the data based on the selector search condition – Brendan Feb 08 '18 at 21:56
  • Oh, that's cool. I also had a problem with my PXSelect. When I was selecting things (when a purchase order is made, as things are received, it will create one ObjectA with several lines. But, only if they receive everything at one time which is not the case most of the time in practicality) So, I was selecting all lines of ObjectA and joining the header. Which doesn't allow the link to the graph. When I swapped ObjectALines to ObjectA, the link comes over correctly. Thanks for the help! – Kyle S Feb 09 '18 at 14:27
  • no problem. Would be good to post your findings as your own answer for others to view. – Brendan Feb 09 '18 at 14:49

1 Answers1

0

Added PXPrimaryGraph< ObjectA > to the object itself.

My original PXSelectJoin was Selecting all ObjectALines with a join to ObjectA. Which apparently doesn't work for bringing the link over. You needed a proper join of PXSelectJoin< Header, Join< Lines > > to get the link.

Once this completed, the link worked correctly in the Grid. (Thanks to https://stackoverflow.com/users/2056380/brendan)

Kyle S
  • 132
  • 8