Editor Left Join Inside Mjoin

Editor Left Join Inside Mjoin

vincmeistervincmeister Posts: 136Questions: 36Answers: 4

Hello Allan,
Is it possible to put LeftJoin inside Mjoin?

I want to create a child detail row like this example with one ( tr_delivery_head ) to many ( tr_receiving_detail ) direct table.

My code working good so far, but I want to display item_name field from master_item table, which linked to tr_receiving_detail table using item_code field.

So far on normal left join, i'm using this and works

Field::inst( 'item_code' )
    ->options( 'master_item', 'item_code', 'item_name' ),
Field::inst( 'item_name' ),
...
->leftJoin('master_item','master_item.item_code', '=', 'tr_receiving_detail.item_code')

Unfortunately this is not working inside MJoin

->join(
            Mjoin::inst('tr_receiving_detail')
                ->link('tr_delivery_head.psm_no','tr_receiving_detail.psm_no')
                ->fields(
                    Field::inst( 'item_code' ),
                    //  ->options( 'master_item', 'item_code', 'item_name' ),
                    //Field::inst( 'item_name' ),
                    Field::inst( 'quantity' ),
                    Field::inst( 'enduser_code' ),
                    Field::inst( 'enduser_name' )
                )
                //->leftJoin('master_item','master_item.item_code', '=', 'tr_receiving_detail.item_code')
        )

Please advise, thank you

Danny

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Is it possible to put LeftJoin inside Mjoin?

    I hate to say this twice in a day, but no, that isn't something that is possible in Editor's libraries at the moment. Sorry!

    Allan

  • vincmeistervincmeister Posts: 136Questions: 36Answers: 4

    OK Allan, thank you

This discussion has been closed.