public void insert()
{
ttsbegin;
next insert();
SalesQuotationTable::updateProjQuotationValue(this.ProjIdRef);
ttscommit;
}
private static void updateProjQuotationValue(ProjId _projId)
{
if (!_projId)
{
return;
}
SalesQuotationTable quotation;
select sum(QuotationValue) from quotation
where quotation.ProjIdRef == _projId;
ProjTable projTable = ProjTable::find(_projId, true);
projTable.QuotationValue = quotation.QuotationValue;
projTable.update();
}
[ExtensionOf(tableStr(SalesQuotationTable))]
final class DT_SalesQuotationTable_Extension
{
public void Insert()
{
next Insert();
SalesQuotationTable salesQuotationTable;
ProjTable projTable;
if(projTable.ProjId != "")
{
select sum(quotationValue) from salesQuotationTable
join projTable
where projTable.ProjId == this.ProjIdRef;
projTable.quotationValue = salesQuotationTable.quotationValue;
projTable.update();
}
}
}
public static SalesQuotationTable findProjId(ProjId _projId,
boolean _forupdate = false)
{
SalesQuotationTable salesQuotationTable;
if (isConfigurationkeyEnabled(configurationKeyNum(Project)) && _projId)
{
salesQuotationTable.selectForUpdate(_forupdate);
select firstonly salesQuotationTable
where salesQuotationTable.ProjIdRef == _projId;
}
return salesQuotationTable;
}
André Arnaud de Cal...
292,031
Super User 2025 Season 1
Martin Dráb
230,868
Most Valuable Professional
nmaenpaa
101,156