Skip to main content

Posts

Showing posts with the label strfind

Find a first occurrence of a character in a string in MSD axapta

strFind (Find a first occurrence of a character in a string) info("int strFind(str _text,str _characters,int _position,int _number)"); info("Searches a text string for the first occurrence of one of the specified characters."); info("_text- The text string to search."); info("_characters - The characters to search for."); info("_position - The position in the text string where the search begins."); info("_number - The number of characters to search."); info("strFind(\"ABCDEFGHIJ\",\"C\",1,10) " + int2str(strFind("ABCDEFGHIJ","C",1,strLen("ABCDEFGHIJ")))); info("strFind(\"ABCDEFGHIJ\",\"C\",10,-10) " + int2str(strFind("ABCDEFGHIJ","C",strLen("ABCDEFGHIJ"),(-1) * strLen("ABCDEFGHIJ"))));

Some important function which used in axapta

Get current user id str s;   ;   s = curuserid();   print "Current user ID is " + s;   pause; Field id to field Name str name;   tableid _tableId;   fieldid _fieldid;   ;   _tableId = tablename2id("Address");   _fieldId = fieldname2id(_tableId, "Name");   name = fieldid2pname(_tableId, _fieldid);   print name;   pause; To get next month of given date   date d;       ;       d = nextmth(today()); //For example, NextMth(29\02\1996) returns the date '29\03\1996', but NextMth(31\01\1996) returns the date '29\02\1996' (leap year).       print "Next month is " + date2str(d, 2, 2, -1, 2, -1, 4);        pause; To delete string from string str s;   ;   s = strdel("TESTstring", 5, 6);   print s;   pause; Find string using strfind int i;   ;   i = strnfind("test", "s", 3, 4);   print "i = " + int2str(i); scan string from string using strscan int i;   ;   i