Help with Scripting a Relationship

Su522
Kilo Sage

In Order Management: 

How can I script a Relationship from the 'Oder Line Item' to the 'Product Order'?

System Defenition > Relationships

Order Line Item: sn_ind_tmt_orm_order_line_item

Product Order: sn_ind_tmt_orm_product_order 

Field on Order Line Item table: order_line_item

Field on Product Order Table: number

See attached.

 

I need to create a Related List on the Product Order table that displays the associated Order Line Items.

Greatly appreciate help!!!

Thank you

 

 

1 ACCEPTED SOLUTION

No worries @Su522,

 

I see, so you want to show all the Order Line Items under the same Order. I don't have much experience with Order Management but I don't think this is how you should be using it. An Order Line Item should be linked to a Product Order and the PO shouldn't be shared across multiple OLIs.

JamesChun_0-1711074031837.png

 

But once again, you can use the below script:

 

(function refineQuery(current, parent) {
    current.addEncodedQuery('order=' + parent.order_line_item.order);
})(current, parent);

Cheers

View solution in original post

7 REPLIES 7

@James Chun 

Hi James,

Could you please help me again?

How do I do this same query in a Client Script?

(function refineQuery(current, parent) {
    current.addEncodedQuery('order=' + parent.order_line_item.order);
})(current, parent);

Hey @ssellmeyer,

Sorry, what are you trying to do with a client script?

@James Chun

How can I do that same query in a Client Script?

(function refineQuery(current, parent) {

    current.addEncodedQuery('order=' + parent.order_line_item.order);

})(current, parent);

 

I really appreciate your help!

Thank you