IF IsComputed field is yes in dataentitys which is unbounded control fields
Change the below properties on the unbounded field level IsComputed field is yes
-Add the EDT
-Data Entity view method - GHMCRetrieveBalance
public class GHMCCustomerBalanceEntity extends common
{
/// <summary>
/// Retrieves Balance of the Customer
/// </summary>
/// <returns></returns>
public static str GHMCRetrieveBalance()
{
str balance;
balance = @'
SELECT SUM(CUSTTRANSOPEN.AMOUNTMST) FROM CUSTTRANS
join CUSTTRANSOPEN on CUSTTRANS.RecId = CUSTTRANSOPEN.RefRecId
and CUSTTRANSOPEN.DATAAREAID = T1.DATAAREAID
group by CurrencyCode,custTrans.ACCOUNTNUM
having custTrans.ACCOUNTNUM = T1.ACCOUNTNUM
';
return balance;
}
/// <summary>
/// Retrieves Current Balance
/// </summary>
/// <returns></returns>
public static str GHMCRetrieveCurrentBalance()
{
str currentBalance;
currentBalance = @'
SELECT (CREDITMAX -(SELECT SUM(ESTIMATE) FROM SALESTABLE
WHERE CUSTACCOUNT = T1.ACCOUNTNUM AND DATAAREAID = T1.DATAAREAID))
AS CURRENTBALANCE FROM CUSTTABLE WHERE ACCOUNTNUM = T1.ACCOUNTNUM
AND DATAAREAID = T1.DATAAREAID
';
return currentBalance;
}
}
Change the below properties on the unbounded field level IsComputed field is yes
-Add the EDT
-Data Entity view method - GHMCRetrieveBalance
public class GHMCCustomerBalanceEntity extends common
{
/// <summary>
/// Retrieves Balance of the Customer
/// </summary>
/// <returns></returns>
public static str GHMCRetrieveBalance()
{
str balance;
balance = @'
SELECT SUM(CUSTTRANSOPEN.AMOUNTMST) FROM CUSTTRANS
join CUSTTRANSOPEN on CUSTTRANS.RecId = CUSTTRANSOPEN.RefRecId
and CUSTTRANSOPEN.DATAAREAID = T1.DATAAREAID
group by CurrencyCode,custTrans.ACCOUNTNUM
having custTrans.ACCOUNTNUM = T1.ACCOUNTNUM
';
return balance;
}
/// <summary>
/// Retrieves Current Balance
/// </summary>
/// <returns></returns>
public static str GHMCRetrieveCurrentBalance()
{
str currentBalance;
currentBalance = @'
SELECT (CREDITMAX -(SELECT SUM(ESTIMATE) FROM SALESTABLE
WHERE CUSTACCOUNT = T1.ACCOUNTNUM AND DATAAREAID = T1.DATAAREAID))
AS CURRENTBALANCE FROM CUSTTABLE WHERE ACCOUNTNUM = T1.ACCOUNTNUM
AND DATAAREAID = T1.DATAAREAID
';
return currentBalance;
}
}
No comments:
Post a Comment