Skip to main content

Posts

Showing posts with the label textbuffer

How to separate Fraction and Digit from Number in axapta

To separate Fraction and Digit from Number in axapta like number is 878778.3000 and you want to get 878778 and .300 then below code can help you to get the same. qty t=878778.3000; str _amount = strFmt("%1",num2str(t,0,1,0,0)); boolean decimals; TextBuffer txtAmount = new TextBuffer(); txtAmount.setText(_amount); if (txtAmount.find("^[0-9]+$")) // Regular expression inside the find method { decimals = true; } info(strFmt("%1 -- %2",trunc(t),frac(t)));

Get All the fields in a table through code in MSD axapta

Get All the fields in a table through code The idea behind writing this job is to make clear the concepts of sqlDictionay and how to get the fields from a table. Also a little introduction to file generation class(TextBuffer).This job create a CSV file by name fieldlist in C: drive static void fieldsInTable(Args _args) { str fieldList = ''; SqlDictionary sqlDictionary; TextBuffer buffer = new TextBuffer(); ; while select * from sqlDictionary where sqlDictionary.tabId==tablenum(salestable) { fieldList += sqlDictionary.sqlName; fieldlist += '\r'; } if (fieldList) fieldList = subStr(fieldList,1,strLen(fieldList)-1); buffer.setText(fieldlist); buffer.toFile("c:\\fieldslist.csv"); }