I) Edit Method in Form Level :
1. Form >> Class declaration
Map custPriceMap;
2 . Init method of form
custPriceMap= new map(Types::Int64, Types::Real);
Add new method Datasource ,
Edit Price CustPrice(boolean _set ,
Salesline _salesLine,
Price _price)
{
Price price = _price;
;
if(_set)
{
custPriceMap.insert(_salesLine.RecId,_price);
SalesLine.SalesPrice = _price / (1-_salesLine.LinePercent/100)+ this.FET(_salesLine)+_salesLine.LineDisc;
Salesline.modifiedField(fieldNum(SalesLine,SalesPrice));
price = _price;
}
else
{
if (_salesLine.RecId && dkCustMap.exists(_salesLine.RecId))
{
price= custPriceMap.lookup(_salesLine.RecId);
}
else if (_salesLine.SalesPrice)
{
price = (_salesLine.SalesPrice-this.FET(_salesLine) - _salesline.LineDisc)*(1-_salesline.LinePercent/100);
custPriceMap.insert(_salesLine.RecId,price);
}
else
{
price = 0;
}
}
return price;
}
II) Edit Method in Table Level :
Edit boolean Marked(boolean _set ,
boolean _mark)
{
FinderRecords finderrec;
boolean mark = _mark;
finderrec = FinderRecords::findByFinderNo(this.FinderNumber,_set);
if(_set)
{
ttsBegin;
finderrec.Mark = _mark;
finderrec.update();
ttsCommit;
}
else
{
mark = finderrec.mark;
}
return mark;
}
1. Form >> Class declaration
Map custPriceMap;
2 . Init method of form
custPriceMap= new map(Types::Int64, Types::Real);
Add new method Datasource ,
Edit Price CustPrice(boolean _set ,
Salesline _salesLine,
Price _price)
{
Price price = _price;
;
if(_set)
{
custPriceMap.insert(_salesLine.RecId,_price);
SalesLine.SalesPrice = _price / (1-_salesLine.LinePercent/100)+ this.FET(_salesLine)+_salesLine.LineDisc;
Salesline.modifiedField(fieldNum(SalesLine,SalesPrice));
price = _price;
}
else
{
if (_salesLine.RecId && dkCustMap.exists(_salesLine.RecId))
{
price= custPriceMap.lookup(_salesLine.RecId);
}
else if (_salesLine.SalesPrice)
{
price = (_salesLine.SalesPrice-this.FET(_salesLine) - _salesline.LineDisc)*(1-_salesline.LinePercent/100);
custPriceMap.insert(_salesLine.RecId,price);
}
else
{
price = 0;
}
}
return price;
}
II) Edit Method in Table Level :
Edit boolean Marked(boolean _set ,
boolean _mark)
{
FinderRecords finderrec;
boolean mark = _mark;
finderrec = FinderRecords::findByFinderNo(this.FinderNumber,_set);
if(_set)
{
ttsBegin;
finderrec.Mark = _mark;
finderrec.update();
ttsCommit;
}
else
{
mark = finderrec.mark;
}
return mark;
}
No comments:
Post a Comment