Join
Join
Hello, I am having problem with join no id column,
Error
DataTables warning: table id=IM_ItemVendor - Requested unknown parameter 'IM_ItemVendor.VendorNo' for row 0, column 0.
Join to tables no ID column, same column name oh both tables
Editor::inst( $db, 'IM_ItemVendor', 'VendorNo' )
->fields(
Field::inst( 'VendorNo' ),
Field::inst( 'ItemCode' ),
Field::inst( 'LastReceiptDate' )
->validator( Validate::dateFormat( 'D, j M Y' ) )
->getFormatter( Format::dateSqlToFormat( 'D, j M Y' ) )
->setFormatter( Format::dateFormatToSql( 'D, j M Y' ) ),
Field::inst( 'LastLeadTime' ),
Field::inst( 'LastReceiptPurchaseOrderNo' )
)
leftJoin( 'AP_Vendor', 'AP_Vendor.VendorNo', '=', 'IM_ItemVendor.VendorNo' )
Answers
Hello,
I don't understand your probleme, can you show the js or explain your table please ?
Since you are joining two tables with identical column names you must use the respective table name as a prefix in your field instances.
e.g. Field::inst( 'IM_ItemVendor.VendorNo' )
etc.
Hello I try it but keeps error
On the client-side I suspect you currently have:
for the column. Change it to just be:
You only need the table name if you had also specified it in the field at the server-side.
Allan