28 January 2011

FileOpen window with job select file or Browser window

static void Select_FileOpen(Args _args)
{
/*
This is the demonstration to select the file as a browser window
you can create fileOpen browser window
*/

Dialog dialog;
DialogField dialogField;
Filename filename;
;

dialog = new Dialog("FileOpen");
dialogfield = dialog.addField(typeid(Filenameopen), "File Name");
dialog.run();


if (dialog.run())
{
filename = (dialogfield.value());

}

info(filename);



}

27 January 2011

How to stop the journal posting in GL

Here we can stop the Journal Posting per each chart of Account
select one COA and follow step:
GL->Chart of Accounts -> General Tab -> Administration Group -> Locked in Journal
Check this Box

how to use Resources

To assign sysResource:
Create any button in form->properties->ButtonDisplay: ImageOnly
Property->NormalResource : 104
104 is the Resource ID:::Tools->DevTools->Embeded Resources

To assign User Resource:
Create any button in form->properties->ButtonDisplay: ImageOnly
roperty->NormalImage: select your Image in this area..

25 January 2011

Transfer of modifications from Development to test Environment

Transfer of modifications from Development to test

Close all connections to the files
Shut down all clients
Shut down AOS
Shut down Business connector

Copy the new and modified application files
axXXX.aod
axXXXen-us.ald

Paste files in Destination Environment
axXXX.aod
axXXXen-us.ald

Start the destination environment
Compile the entire AOT
Synchronize the entire database

20 January 2011

compare base enums in a query

Click here
static void Compare_Base_Enums(Args _args)
{
PurchStatus purchstatus;
PurchTable purchTable;
;

purchstatus = Global::enum2int(PurchStatus::Invoiced); // this statement returning baseEnum element value

while select purchTable where purchTable.PurchStatus < enum2int(PurchStatus::Canceled)
{
info(strfmt("%1",purchTable.PurchStatus));
}

}

11 January 2011

Random Generation of number

static void RandomGenerateEg(Args _args)
{
RandomGenerate objRG = new RandomGenerate();
Random objRandom = new Random();
;
//This generates random numbers specified within the given range
//info(int2Str(objRG.randomInt(10,55)));

//This generates random numbers
info(int2Str(objRandom.nextInt()));
}

generate sequence number

static void SequenceEg(Args _args)
{
Sequence objSeq = new Sequence("Test Sequence",8,10,250,1);
print objSeq.currval(); // Displays the current value of the object
while(1)
{
print objSeq.nextval(1);
pause;
}
}

Service class to get the selected record and deleted matching records and refresh the form data source in D365 F&O

 [DataContractAttribute] class ABCUserProfilesBulkDeleteContract {         UserId userId;     [DataMemberAttribute('UserId')]     pu...