[ExtensionOf(formStr(ProjWorkBreakdownStructureV2))]
final class DT_PSAActivityEstimatesDK_Extension
{
Edit NonNegativeTotal TotalCostPrice(boolean _set ,NonNegativeTotal _TotalCostPrice )
{
NonNegativeTotal TotalCostPrice = _TotalCostPrice ;
SalesQuotationTable salesQuotationTable;
Hierarchy hierarchy = this.args().record();
HierarchyLinkTable hierarchyLinkTable;
ProjPlanVersion projPlanVersion;
HierarchyTreeTable hierarchyTreeTable;
HierarchyIdBase HierarchyId;
QuotationIdBase _quotationId;
_quotationId = this.dataSource(formDataSourceStr(ProjWorkBreakdownStructureV2,ProjPlanVersion )).object(fieldNum(ProjPlanVersion, TaskName)).getValue();
HierarchyId = hierarchy.HierarchyId;
select * from salesQuotationTable
join hierarchyLinkTable
where hierarchyLinkTable.RefRecId == salesQuotationTable.RecId
join hierarchy
where hierarchyLinkTable.HierarchyId == hierarchy.HierarchyId
join hierarchyTreeTable
where hierarchyTreeTable.HierarchyId == hierarchy.HierarchyId
join projPlanVersion
where projPlanVersion.HierarchyTreeTableRefRecId == hierarchyTreeTable.RecId
&& projPlanVersion.TaskName == _quotationId;
;
if(_set)
{
if(TotalCostPrice)
{
ttsbegin;
salesQuotationTable.reread();
salesQuotationTable.selectForUpdate(true);
salesQuotationTable.ProjectValue = TotalCostPrice;
salesQuotationTable.validateWrite();
salesQuotationTable.doupdate();
ttscommit;
}
}
else
{
TotalCostPrice = salesQuotationTable.ProjectValue;
}
//info(this.dataSource(formDataSourceStr(ProjWorkBreakdownStructureV2,ProjPlanVersion )).object(fieldNum(ProjPlanVersion, TaskName)).getValue());
info(strFmt("QuotationID%1 & Projectvalue%2",salesQuotationTable.QuotationId,salesQuotationTable.ProjectValue));
return TotalCostPrice;
}
}
[ExtensionOf(tableStr(SalesQuotationTable))]
final class DT_SalesQuotationTableDK_Extension
{
public boolean validateWrite()
{
PSAActivityEstimates pSAActivityEstimates;
ProjPlanVersion projPlanVersion;
HierarchyTreeTable hierarchyTreeTable;
Hierarchy hierarchy;
HierarchyLinkTable hierarchyLinkTable;
SalesQuotationTable salesQuotationTable;
NonNegativeTotal TotalCostPrice;
boolean ret;
;
next validateWrite();
while select sum(TotalCostPrice) from psaActivityEstimates
join projPlanVersion
where projPlanVersion.HierarchyId == psaActivityEstimates.ProjPlanHierarchyId
&& projPlanVersion.HierarchyTaskId == psaActivityEstimates.ProjPlanHierarchyTaskId
join hierarchyTreeTable
where hierarchyTreeTable.RecId == projPlanVersion.HierarchyTreeTableRefRecId
join hierarchy
where hierarchy.HierarchyId == hierarchyTreeTable.HierarchyId
join hierarchyLinkTable
where hierarchyLinkTable.HierarchyId == hierarchy.HierarchyId
join salesQuotationTable
where salesQuotationTable.RecId == hierarchyLinkTable.RefRecId
&& salesQuotationTable.QuotationId == this.QuotationId
{
TotalCostPrice = psaActivityEstimates.TotalCostPrice;
if(this.ProjectValue > TotalCostPrice)
{
ret = checkFailed("Value must not be greater than total cost price");
}
}
return ret;
}
}
[ExtensionOf(formStr(ProjWorkBreakdownStructureV2))]
final class DT_PSAActivityEstimatesDK_Extension
{
Edit NonNegativeTotal TotalCostPrice(boolean _set ,NonNegativeTotal _TotalCostPrice )
{
NonNegativeTotal TotalCostPrice = _TotalCostPrice ;
SalesQuotationTable salesQuotationTable;
Hierarchy hierarchy = this.args().record();
HierarchyLinkTable hierarchyLinkTable;
ProjPlanVersion projPlanVersion;
HierarchyTreeTable hierarchyTreeTable;
HierarchyIdBase HierarchyId;
HierarchyId = hierarchy.HierarchyId;
select * from salesQuotationTable
join hierarchyLinkTable
where hierarchyLinkTable.RefRecId == salesQuotationTable.RecId
join hierarchy
where hierarchyLinkTable.HierarchyId == HierarchyId
join hierarchyTreeTable
where hierarchyTreeTable.HierarchyId == HierarchyId
join projPlanVersion
where projPlanVersion.HierarchyTreeTableRefRecId == hierarchyTreeTable.RecId;
//salesQuotationTable = this.args().record();
;
if(_set)
{
if(TotalCostPrice)
{
ttsbegin;
salesQuotationTable.reread();
salesQuotationTable.selectForUpdate(true);
salesQuotationTable.ProjectValue = TotalCostPrice;
salesQuotationTable.validateWrite();
salesQuotationTable.doupdate();
ttscommit;
}
}
else
{
TotalCostPrice = salesQuotationTable.ProjectValue;
}
info(this.dataSource(formDataSourceStr(ProjWorkBreakdownStructureV2,ProjPlanVersion )).object(fieldNum(ProjPlanVersion, TaskName)).getValue());
return TotalCostPrice;
//info(strFmt('%1' ,this.args().caller()));
}
}
[ExtensionOf(tableStr(SalesQuotationTable))]
final class DT_SalesQuotationTableDK_Extension
{
public boolean validateWrite()
{
PSAActivityEstimates pSAActivityEstimates;
ProjPlanVersion projPlanVersion;
HierarchyTreeTable hierarchyTreeTable;
Hierarchy hierarchy;
HierarchyLinkTable hierarchyLinkTable;
SalesQuotationTable salesQuotationTable;
NonNegativeTotal TotalCostPrice;
boolean ret;
;
next validateWrite();
while select sum(TotalCostPrice) from psaActivityEstimates
join projPlanVersion
where projPlanVersion.HierarchyId == psaActivityEstimates.ProjPlanHierarchyId
&& projPlanVersion.HierarchyTaskId == psaActivityEstimates.ProjPlanHierarchyTaskId
join hierarchyTreeTable
where hierarchyTreeTable.RecId == projPlanVersion.HierarchyTreeTableRefRecId
join hierarchy
where hierarchy.HierarchyId == hierarchyTreeTable.HierarchyId
join hierarchyLinkTable
where hierarchyLinkTable.HierarchyId == hierarchy.HierarchyId
join salesQuotationTable
where salesQuotationTable.RecId == hierarchyLinkTable.RefRecId
&& salesQuotationTable.QuotationId == this.QuotationId
{
TotalCostPrice = psaActivityEstimates.TotalCostPrice;
if(this.ProjectValue > TotalCostPrice)
{
ret = checkFailed("Value must not be greater than total cost price");
}
}
return ret;
}
}
if (this.ProjectValue > psaActivityEstimates.TotalCostPrice)
{
ret = checkFailed("Value must not be greater than total cost price");
}
[ExtensionOf(formStr(ProjWorkBreakdownStructureV2))]
final class DT_PSAActivityEstimatesDK_Extension
{
Edit NonNegativeTotal TotalCostPrice(boolean _set ,NonNegativeTotal _TotalCostPrice )
{
NonNegativeTotal TotalCostPrice = _TotalCostPrice ;
SalesQuotationTable salesQuotationTable;
Hierarchy hierarchy = this.args().record();
HierarchyLinkTable hierarchyLinkTable;
HierarchyIdBase HierarchyId;
HierarchyId = hierarchy.HierarchyId;
select * from salesQuotationTable
join hierarchyLinkTable
where hierarchyLinkTable.RefRecId == salesQuotationTable.RecId
join hierarchy
where hierarchyLinkTable.HierarchyId == HierarchyId;
//salesQuotationTable = this.args().record();
;
if(_set)
{
if(TotalCostPrice)
{
ttsbegin;
salesQuotationTable.reread();
salesQuotationTable.selectForUpdate(true);
salesQuotationTable.ProjectValue = TotalCostPrice;
salesQuotationTable.doupdate();
ttscommit;
}
}
else
{
TotalCostPrice = salesQuotationTable.ProjectValue;
}
return TotalCostPrice;
}
}
[ExtensionOf(tableStr(SalesQuotationTable))]
final class DT_SalesQuotationTableDK_Extension
{
public boolean validateWrite()
{
PSAActivityEstimates pSAActivityEstimates;
boolean ret;
;
next validateWrite();
if(this.ProjectValue > PSAActivityEstimates.TotalCostPrice)
{
warning("Value must not be greater than total cost price");
}
//else
//warning(" Please fill the address value");
return ret;
}
}
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156