Thursday, February 23, 2012

AllowEdit setting for all form datasource fields

 
void  AA_editSales()
{
    SysDictTable dictTable = new SysDictTable(tablenum(salestable));
    Counter      i;
    fieldId      fieldId;
    ;
    salesTable_ds.allowCreate  (false);
    salesTable_ds.allowEdit    (salesTableForm.editHeaderAllowed());
    salesTable_ds.allowDelete  (false);
    
    if (salesTableForm.editHeaderAllowed())
    {
        for (i=1; i<=dictTable.fieldCntWithoutSys() ;i++)
        {
            fieldId = dictTable.fieldCnt2Id(i);
            switch (fieldId)
            {
                case fieldnum(salestable,URL):
                
                    SalesTable_DS.object(dictTable.fieldCnt2Id(i)).allowEdit(true);
                    break;
                default:
                    SalesTable_DS.object(dictTable.fieldCnt2Id(i)).allowEdit(false);
            }

        }
    }
    
}

Calling menu string using args, formrun using args

 
Args args = new Args();

;

switch (_menuItemName)
{
    case menuitemoutputstr(PurchPackingSlipCopy) :
        args.record(vendPackingSlipJour);
        new Menufunction(menuitemoutputstr(PurchPackingSlipCopy),MenuItemType::Output).run(args);
    break;
    case menuitemoutputstr(PurchPackingSlipOriginal) :
        args.record(vendPackingSlipJour); 
        new Menufunction(menuitemoutputstr(PurchPackingSlipOriginal),MenuItemType::Output).run(args); 
    break; 
    case menuitemoutputstr(PurchPackingSlip) : 
        args.record(vendPackingSlipJour); 
        new Menufunction(menuitemoutputstr(PurchPackingSlip),MenuItemType::Output).run(args); 
    break;
} 


Args args = new Args(); 
FormRun formRun; 
; 
args.name( formstr(SalesTable) ); 
args.caller(this); args.record(salesTable); 
args.parm("OrderAmendment"); 
formRun = classFactory.formRunClass( args ); 
formRun.init(); 
formrun.run(); 
formrun.wait(); 

Wednesday, February 22, 2012

Connecting to Dynamics AOS Services on Remote destop

 
Here is a cool tip, if you don't want to connect to a remote computer where
the AOS is running to start and stop the AOS Services.
You can just go to Services, Right-click the services and 
click "Connect to another computer". 
The authentication (login) should be same for the current system and 
the Remote desktop.