Skip to main content

Posts

Showing posts from October, 2011

Deletes a specified part of a text string in MSD axapta

StrDel (Deletes a specified part of a text string) info("str strDel(str _text,int _position,int _number)"); info("Deletes a specified part of a text string."); info("_text - The text string to delete characters from."); info("_position - The position at which to start deleting characters."); info("_number - The number of characters to delete (including the character at position)."); info("strDel(\"ABCDEFGH\",2,3) " + strDel("ABCDEFGH",2,3)); info("strDel(\"ABCDEFGH\",5,-3) " + strDel("ABCDEFGH",5,-3));

Insert a string into another string using MSD axapta x++

strIns (Insert a string into another) info("str strIns(str _text1, str _text2, int _position)"); info("Inserts a text string into another text string."); info("_text1 - The original text string."); info("_text2 - The text string to insert into _text1."); info("_position - The position in _text1 where _text2 is to be inserted."); info("strIns(\"ABFGH\",\"CDE\",3) " + strIns("ABFGH","CDE",3));

Get number sequence code through code in MSD axapta

To Create a new number sequence Basic>Setup>NumberSequence>NumberSequence e.g. test_NS with format ######_NS Now in any form Where the Table e.g. test_NumberSequence is used, override create method of test_NumberSequence under DataSource Node and do the following //1. in class declaration of form public class FormRun extends ObjectRun { numberSeq numberSeq; } //2. in create method of test_NumberSequence public void create(boolean _append = false) { super(_append); numberSeq = NumberSeq::newGetNumFromCode("test_NS", true,true); if (numberSeq) { test_NumberSequence.NS_id = numberSeq.num(); } }

Parmobject with container in MSDAx

parmObject (Container) //1. Send void clicked() { Args args = new Args(); ContainerClass conClass_Obj; Container conSend; ; conSend = conins(conSend, 1, "Call Of Duty"); conSend = conins(conSend, 2,"BattleField"); conSend = conins(conSend, 3, "Assisins Creed"); conSend = conins(conSend, 4, "retrive hell"); conClass_Obj = new ContainerClass(conSend); Args.parmObject(conClass_Obj); new MenuFunction(menuitemdisplaystr(test_ParamObject_Recieve), MenuItemType::Display).run(args); } //2. Receive public void init() { //super(); str s1,s2,s3,s4; containerClass conClass_Obj; container conRec; Args args; ; super(); args = new args(); conClass_Obj = element.args().parmObject(); conRec = conClass_Obj.value(); s1 = conpeek(conRec,1); s2 = conpeek(conRec,2); s3 = conpeek(conRec,3); s4 = conpeek(c

Find a first occurrence of a character in a string in reverse in MSD axapta x++

strNFind  (Find a first occurrence of a character in a string in reverse) info("int strNFind(str _text,str _characters,int _position,int _number)"); info("Searches a portion of a text string for the first occurrence of a character that is not included in a specified list of characters."); info("_text - The text string to search."); info("_characters - The list of characters to exclude from the search."); info("_position - The position in the string that the search should start at."); info("_number - The number of characters to search."); info("strNFind(\"ABCDE\",\"ABCE\",1,5) " + int2str(strNFind("ABCDE","ABCE",1,strLen("ABCDE"))));

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"))));

Compares two text strings in MSD axapta x++ language

strCmp (Compare Two Strings) info("int strCmp(str text1, str text2)"); info("Compares two text strings. The function is case-sensitive."); info("0 if the two strings are identical, 1 if the first string is longer, or -1 if the second string is longer."); info("e.g."); info("strCmp(\"abc\",\"abc\") = " + int2str(strCmp("abc","abc"))); info("strCmp(\"ABC\",strUpr(\"abc\")) = " + int2str(strCmp("ABC",strUpr("abc")))); info("strCmp(strLwr(\"ABC\"),\"abc\") = " + int2str(strCmp(strLwr("ABC"),"abc")));

Converts string to lowercase in axapta x++ language MSDAX

To Converts all letters in a text string to lowercase in axapta x++ language You can try following code in job. I hope this can be helpful for you for string manipulation programs. strLwr (String Lower) info("str strLwr(str _text)"); info("Converts all letters in a text string to lower case."); info("strLwr(\"ABcd123xYZ\") " + strLwr("ABcd123xYZ"));

Send and recieve parameter string by args in MSD axapta

Send and recieve parameter string through args in axapta 1. Send void clicked() { Args args = new Args(); ; Args.parm("retrive hell"); new MenuFunction(menuitemdisplaystr(abc_Param_String_Recieve), MenuItemType::Display).run(args); } 2. Receive public void init() { // super(); str paramString; Args args; ; super(); args = new args(); paramString = element.args().parm(); info(strfmt("paramString = %1",paramString)); }

Section Group Report using fetch in MSDAX

In Section Group Report not using fetch(Query) only drag and drop the fields you want to get displayed from tables in datasource node In Section Group Report using fetch(Query)  drag and drop the field you want to displayed from tables in datasource node  and do the following public boolean fetch() { test_ItemYN test_ItemYN_Obj; QueryRun qr; QueryBuildDataSource qbds_test_ItemYN, qbds_test_Item_Price; Query q = new Query(); QueryBuildLink QueryBuildLink1; ; q = new query(); qbds_test_ItemYN = q.addDataSource(tableNum(test_ItemYN)); qbds_test_Item_Price = qbds_test_ItemYN.addDataSource(tablenum(test_Item_Price)); // qbds.addLink(fieldnum(pARENTtABLE, FD_Id), fieldnum(cHILDtABLE, Parent_FD_Id)); qbds_test_Item_Price.addLink(fieldnum(test_ItemYN, ItemId), fieldnum(test_Item_Price, ItemId)); qbds_test_Item_Price.relations(true); //qbds_test_Item_Price.joinMode(JoinMode::ExistsJoin);// JoinMode::InnerJoin qbds_t

For Loop Selection from Grid in MSD axapta

For Loop Selection from Grid Syntax of for loop will be like this for ( <your table object>= _formDS.getFirst(true) ? _formDS.getFirst(true) : [_args.record()]/ [TableName]; <your table object>; <your table object> = _formDS.getNext() ) { //you can understand better way by using this example. } for ( Employee1 = Employee_ds.getFirst(true) ? Employee_ds.getFirst(true) : Employee; Employee1; Employee1 = Employee_ds.getNext() ) { args.record(Employee1); new MenuFunction(menuitemoutputstr(EmployeeReport), MenuItemType::Output).run(args); }

Simple runtime lookup code in axapta x++ language of Microsoft MSDAX

Simple runtime lookup code in axapta x++ language of Microsoft public void lookup() { //super(); SysTableLookup tableLookup; QueryBuildDataSource qbds_Test_Item_YN; Query q = new Query(); ; tableLookup = SysTableLookup::newParameters(tableNum(Test_ItemYN),this); tableLookup.parmUseLookupValue(false); qbds_Test_Item_YN = q.addDataSource(tableNum(Test_ItemYN)); tableLookup.parmQuery(q); tableLookup.addLookupfield(fieldNum(Test_ItemYN,ItemId)); tableLookup.addLookupfield(fieldNum(Test_ItemYN,ItemName)); tableLookup.performFormLookup(); }

General Features of the BOM Designer in MSDAX

General Features of the BOM Designer in axapta 2012 Use the BOM designer to perform the following actions: • Create new BOM versions or edit the existing ones. • Edit and delete BOM lines. • Check BOMs for errors, for example, BOM circularity. • Check which BOM versions  are attached to the selected BOM. • Check at which sites the BOM versions are assigned. • Print BOM and BOM lines for the selected BOM. • Verify the site to which the BOM line belongs

The complete syntax for the While select statement in MSD axapta

The complete syntax for the While select statement in axapta [while] select [reverse] [firstfast] [firstonly] [firstOnly10] [firstOnly100] [firstOnly1000] [forupdate] [nofetch] [crosscompany] [forcelitterals | forceplaceholders] [forcenestedloop] [forceselectorder] [repeatableRead] [validTimeState] [ * | <fieldlist> from] <tablebuffer> [ index [hint] <indexname> ] [ group by {<field>} ] [ order by {<field> [asc][desc]} ] [ where <expression> ] [ outer | exists | notexists ] join [reverse] [ * | <fieldlist> from] <tablebuffer> [ index <indexname> ] [sum] [avg] [minof] [maxof] [count] [ group by {<field>} ] [ order by {<field> [asc][desc]} ] [ where <expression> ] ] <fieldlist> ::= <field> | <fieldlist> , <field> <field> ::= fieldname | <function>(<field>)

How can you compare layers of MSD Axapta

How can you compare layers of Axapta i) Microsoft Dynamics AX menu >Tools >  Development tools > Code Upgrade > Compare layers ii) Enter the name of Project iii) Select the Surce Layer used as the base layer for the comparison. iv) Select Reference Layer that you want to compare to the Source Layer. v) A new private project will be created in the Project node.

create a new language in MSDAX 2009

create a new language in AX 2009 For creating new language follow the steps. i) Go to AX Menu > Tools > Development Tools > Label > Label File Wizard. ii) Check on Create new label Language then click on Next button. iii) Select language. iv) You can also create new language id by click on Create new language button.

AX among other Dynamics MSDAX

Microsoft bought four independent ERP packages for small to medium business over the years. Microsoft now markets all four + CRM under the Dynamics branding. The ERP packages are AX (Axapta), Great Plains, Navision and Soloman. These four ERP's fit into various customer requirements better or worse depending on what your business requirements are. AX is the choice if a very high degree of customization is required by the customer. The others, not so much.  AX is for EnterpriseMicrosoft Great Plains is TIER 2 application whereas Microsoft AX is TIER 1. TIER 2 means for Small and Medium Size Enterprises  and TIER 1 means Enterprise. Enterprise means where employee count is more than 20,000 and more than 200 concurrent users.

Code For sending data from form to Class using container in MSDAX

Code For sending data from form to Class using container //Write this code on form Container returnAbc() { Container Abc; int conPos = 0; ; conPos ++; Abc= conins(Abc,conPos,test.valueStr()); return Abc; } //Write this Code on class main() { callerForm = _args.caller(); Abc= callerForm.returnFilter(); } void initFilters(Container _Abc) { aAbc = conpeek(_filtAbc,1); }

Code to save previous selected value in form in MSD Axapta

Declare variable in class declaration #define.CurrentVersion(1) #localmacro.CurrentList _itmeid, _description, _classtype #endmacr define pack method public container pack() { return [#CurrentVersion,#CurrentList]; } Then define unpack method public boolean unpack(container _packedClass) { Version version = conpeek(_packedClass,1); ; switch (version) { case #CurrentVersion : [version, #CurrentList] = _packedClass; break; default : return false; } return true; }

Code to generate number sequence in class using MSD axapta

Code to generate number sequence in class using axapta x++ Assign number sequence from parameter table numberSeq = NumberSeq::newGetNumFromCode(LedgerParameters::numRefJournalNum().NumberSequence, true, true); //put value of number sequence to variable this way. voucher = NumberSeq::newGetNumFromCode(ledgerJournalName.VoucherSeries, true, true).num();

Code for uploading image file in table using MSD axapta

Code for uploading image file in table using x++ code FilenameFilter filter = ['Image Files', '*.bmp;*.jpg;*.gif;*.jpeg']; BinData binData = new BinData(); str extest, filepath, nameofFile; ; super(); imageFilePathName = WinAPI::getOpenFileName(element.hWnd(),filter,'',"abc"); if(imageFilePathName && WinAPI::fileExists(imageFilePathName)) { [filepath, nameOfFile,extest] = fileNameSplit(imageFilePathName); if(extest== '.bmp' || extest== '.jpg' || extest== '.gif' || extest== '.jpeg') { bindata.loadFile(imageFilePathName); imageContainer = bindata.getData(); TestTable.Image =imageContainer; TestTable.write(); } else { throw error("Error in uploading"); } }

Difference Between modifiedfield and validatefield method in MSD Axapta

Difference Between modifiedfield and validatefield method modifiedfield and validatefield both method recieve the active field number as parameter.modifiedfield() is used to initialize the value of other fields and does not return an value. while validatefield method  is used for validation only and will return true or false.

Menu path to export table data in Excel Templates in MSD axapta

 This is  a menu path to export table data in Excel Templates. You can keep that data as table backup for security purpose. Administration -> Periodic -> Data Export/Import -> Excel SpreadSheets -> Template Wizard If you want to import that data  again in axapta then you can import same temple using following menu path. Administration -> Periodic -> Data Export/Import ->Import Excel Template.