Display Method

Below is the display() to get the count of all Invoiced Sales Order’s from the SalesTable:

(Write Below Code in CustTable Methods) //For Table Level Coding


[SysClientCacheDataMethodAttribute(true)]
display Int64 InvoicedCount()
{
SalesTable salesTable;
;

SELECT COUNT(RecId) FROM salesTable group by salesTable.CustAccount
Where salesTable.SalesStatus == SalesStatus::Invoiced && salesTable.CustAccount == this.AccountNum;
Return salesTable.RecId;
}

Below is the display() to get the count of all Sales Order’s from the SalesTable:
(Write Below Code in CustTable DataSource Methods)// For Form Level Coding


[SysClientCacheDataMethodAttribute(true)]
display Int64 SalesOrderCount()
{
;
SELECT COUNT(RecId) FROM salesTable group by salesTable.CustAccount
Where salesTable.SalesStatus == SalesStatus::Invoiced
|| SalesStatus::Backorder && salesTable.CustAccount == CustTable.AccountNum;

Return salesTable.RecId;
}

OR

Passing current record buffer


[SysClientCacheDataMethodAttribute(true)]
display DimensionValue BusinessUnit(InventJournalTrans _inventJournalTrans)//Passing current record buffer
{

DimensionAttributeValueSetStorage dimStorage;
Counter i;
DimensionValue dimensionValue;
RefRecId defaultdim;

defaultdim = _inventJournalTrans.DefaultDimension; //this number is basically from field DefaultDimension
dimStorage = DimensionAttributeValueSetStorage::find(defaultdim);

for (i=1 ; i<= dimStorage.elements() ; i++)
{
if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name=='BusinessUnit') //Give the Attribute you want to get the value for.
{
dimensionValue = dimStorage.getDisplayValueByIndex(i);
break;
}
}
return dimensionValue;
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s