Wednesday, 4 March 2015

Conversions

1. Real to string  - Get with format 

Num2Str(custtransopen.AmountMST,10,2,-1,-1)

10 is the length of the string 
2 is the number of decimals
-1 and -1 are the separators before and for the decimal place

2.  Int to string 
int2str .

3. Date to string 
date2str(custtransopen.DueDate,321,DateDay::Digits2,DateSeparator::Slash,DateMonth::Digits2,DateSeparator::Slash,DateYear::Digits4)

4. Recid to string and again back to Recid

static void Job24(Args _args)
{
    ReportTitle title,stringrecid;
     RecId   recid;
    CustTransOpen custtransopen;
    CustTransOpen=  CustTransOpen::find(5637230869);
    title =  "@SYS12128" + "."+int642str(custtransopen.RecId);
    stringrecid   =   subStr(title,9,strLen(title)-8);
    recid   =   str2recId(stringrecid);
    info(strFmt("%1",recid));

}

No comments:

Post a Comment