Microsoft_MVP_banner

AX 2012: StrFind and StrScan functions

Two standard functions strFind and strScan can be used based on business requirement for find a special character from an input string. Here is an example with both functions; Both functions return integer value. StrScan Function Int found = 0; Str target= “Dynamics AX 365 operation”;found = strScan(target, “365”, 0, strLen(target)); where parameters are; 1. string 2. string 3. position 4. number StrFind Function Int found = 0; Str target= “Dynamics AX 365 operation”; found = strFind(target, “X”, 0, strLen(target)); where parameters are; 1. string 2. character 3. position 4. number

AX 2012: Access Denied: ***Controller

Recently I came across the following exception while opening batch job via a menu item which has been written using sysOperation framework. It was happening only with non-admin users so the first thing I could think of permission/access issue. I checked all properties on menu item, everything seems to be set properly as required. Solution:  Created a new server method under security privilege which is created for menu item used to called this import routine.  Select required class, Under method dropdown type your required method [by default it list static methods], and set EffectiveAccess to Invoke.

AX 2012: Convert string to TitleCase using str2CapitalWord function

Requirement: Show customer name on report in TitleCase e.g. faisal fareed should display as Faisal Fareed Solution: str2CapitalWord function does the trick and accomplished the requirement. input string: “faisal fareed” output string: “Faisal Fareed” P.S. There is another function str2Capital which just converts the first letter of the first word e.g. “faisal fareed” will be converted to “Faisal fareed”

FaisalFareed@2025. All rights reserved

Design by T3chDesigns