Updating table from another table
Hi ,
This script is displaying the data from the Name field and not displaying data from DISPLAYPRODUCTNUMBER so it is displaying only the name that is from EcoResProductTranslation Table, but it is not display Displaying DISPLAYPRODUCTNUMBER that is from ECORESPRODUCT Table
For example this example from the actual data in the tow tables :
This Data From ECORESPRODUCT Table
DISPLAYPRODUCTNUMBER RECID
23022 : 100 : 43 : 11/7 : 5637307150
23022 : 145 : 43 : 11/7 : 5637307149
34001 : 150 : 45 : 12/12 : 5637307148
33001 : 10 : 45 : 12/12 : 5637307147
This Data From ECORESPRODUCTTRANSLATION Table
Name RECID
SSx 5637307150
SSx 5637307149
M8z 5637307148
M8x 5637307147
This is the result that to be update to the description filed
SSx 100*43*11/7
SSx 145*43*11/7
M8Z 150*45*12/12
M8X 10*45*12/12
-----------------------------------------------------------------------------------------------
static void updateProductDescription(Args _args)
{
EcoResProduct product;
EcoResProductTranslation translation;
ttsBegin;
while select forUpdate translation
join RecId, DisplayProductNumber from product
where product.RecId == translation.Product
{
translation.Description = strFmt('%1 %2',
translation.Name,
strReplace(subStr(product.DisplayProductNumber, 8, 20), ':', '-'));
print translation.Description;
pause;
// translation.doUpdate();
}
// ttsCommit;
}
----------------------------------------------------------------------------
Can anyone help me how to get the data as the above example
Best regards
Jamil
Reply