Quantcast
Channel: Martin Dráb's Activities
Viewing all 17532 articles
Browse latest View live

Get all form Parts Form controls in D365FO

$
0
0

Hello, i have a quick technical question, 

I want just to loop all Form Part exist in a given form, 

here is my code to retrieve all Form Parts from DirPartyTable form 

But i can't get the result

public class TestFormParts
{
    public void findFormParts(FormBuildControl _buildControl)
    {
        Set                 buttonsSet = new Set(Types::Class);


        FormBuildControl    buildControl;
        int                 i;
        ;

        if (_buildControl.controlCount() > 0)
        {
            for (i = 1; i <= _buildControl.controlCount(); i++)
            {
                buildControl = _buildControl.controlNum(i);
                Info(strFmt("%1", _buildControl.name()));
                this.findFormParts(buildControl);
            }
        }
        else
        {
            if (classidget(_buildControl) == classnum(FormContainerControl))
            {
                buttonsSet.add(_buildControl);
            }
        }
    }

    public static void main(Args _args)
    {
        TestFormParts tes = new testFormParts();
        Form                myForm;
        FormBuildDesign     design;
        FormBuildControl    control;
        FormRun             formRun;
        int                 cnt = 0;

        _args = new Args();
        _args.name(formStr(DirPartyTable));
        formRun = classfactory.formRunClass(_args);
        myForm = formRun.form();
        design = myForm.design();

        for (cnt = 1; cnt <= design.controlCount(); cnt++)
        {
            control = design.controlNum(cnt);
            tes.findFormParts(control);
        }
    }

}

Thanks


The OData API is not returning any error code for errors to handle based on error codes.

$
0
0

We are implementing client application for Dynamics 365 Finance and Dynamics 365 Supply Chain Management. As part of our analysis we required the list of possible error codes for Dynamics. Also as per our analysis the OData API is not returning any error code for the errors. For example when we tries to delete currency object the error is as below

{"error": {"code": "","message": "An error has occurred.","innererror": {"message": "Delete failed for table row of type 'CurrencyEntity'. Infolog: Error: Function CurrencyEntity.delete has been incorrectly called..","type": "Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDeleteException","stacktrace": "   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.DeleteEntity(ChangeOperationContext context, ChangeInfo changeInfo)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.<>c__DisplayClass7_0.<DeleteEntity>b__0(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActions(ChangeOperationContext context)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__3.MoveNext()"
    }
  }
}

Here the "Code" is empty. It is not returning any error code to handle. Is there any pointers to get the error code for each error for OData API call?  Also please help in finding the reference for all the error codes available in Dynamics 365 Finance and Supply Chain Management. Thank you. 

Is there any Web API support available for Dynamics 365 Finance and Supply Chain Management?

$
0
0

As per our observation, the Dynamics 365 CRM has the support for Web API available here. We could retrieve entity definitions using https://xxxxxx.dynamics.com/api/data/vx.x/EntityDefinitions URL. The Web API is has functionality provided to fetch the metadata of the particular object using https://xxxxxxxx.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='xxxxxxxx')/Attributes?$filter=AttributeOf%20eq%20null URL. We are looking similar for Dynamics F&O.

We have Dynamics 365 Finance and Operations on-cloud instance with version 10.0.5 and update 29. As per our understanding the F&O has OData REST API and REST Metadata API which returns entire metadata in single call and there is now API to get the metadata for each entity in separate call. Hence, we are checking the compatibility of Web API with Dynamics 365 F&O to achieve entity level metadata. I have tried with https://xxxxxxxxxxxxxxxx.cloudax.dynamics.com/api/data/v10.29/EntityDefinitions URL to get the entity definitions but it is not working. Any pointers will help. Thank you. 

Synchronize failed when change field data type

$
0
0

Hi,

I'm creating a new table for D365 F&O, it's a custom table. Had created new Data Entity as well with the table and succeeded to synchronize to my database. However I realize after that that one of my field is with wrong datatype. What supposed to be "Datetime" instead it is "Integer"

So back in Visual studio, delete the Field in the table and get a new field with the correct data type, put the same name into the new field. I also recreate the index key since the field is one of my index key.

In my data entity, tried to Restore data source in hope it will get the latest field information from the table, also Regenerate Staging table.

However I still gets an error while Synchronize database. Saying I need to drop the field and add new field --->

AOS database sync failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Incremental sync did not complete successfully. Error: AggregateException:One or more errors occurred.
AOS database sync failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Incremental sync did not complete successfully. Error: AggregateException:One or more errors occurred.
Inner exceptions:
Inner exceptions:
InvalidOperationException:Table 'MyTable': Converting Field 'Year' of Type 'AxTableFieldEnum' to 'AxTableFieldDate' is not support. Please drop the original field, sync the table and add new field with same name if needed.
InvalidOperationException:Table 'MyTable': Converting Field 'Year' of Type 'AxTableFieldEnum' to 'AxTableFieldDate' is not support. Please drop the original field, sync the table and add new field with same name if needed.
InvalidOperationException:Table 'MyTable': Converting Field 'Year' of Type 'AxTableFieldEnum' to 'AxTableFieldDate' is not support. Please drop the original field, sync the table and add new field with same name if needed..
InvalidOperationException:Table 'MyTable': Converting Field 'Year' of Type 'AxTableFieldEnum' to 'AxTableFieldDate' is not support. Please drop the original field, sync the table and add new field with same name if needed..
  

Any suggestion what should I do ? 'coz the error message suggesting what I already did.

Thanks,

Integration Using file

$
0
0

Dear All, 

We are integrating restaurant POS using CSV file with Microsoft Dynamics 365 Finance and Operations.

  1. We are importing data in staging table from file.
  2. After importing data in staging we are creating following documents of Microsoft Dynamics 365 Finance and Operations
    1. Production Order
    2. Sales Order
    3. Sales Order Invoice
    4. Sales Order Invoice Payment
    5. Inventory Movement Journal
    6. Free text Invoice

Number of files 88

Average number of records in each file is 1200

Problem we are facing is performance issue. It is taking 26 Hours to complete the integration. 

where is trouble query from

$
0
0

Hi Friends,

Looking for suggestion to figure out where is the 'AX' query from, we ran into a problem, a query slows down entire system. See attached.

How can we find out where is this query from in AX, report, query or something else? it'd be better to figure who ran it.

I have searched tables names, but didn't find class or form related to it.

SELECT T1.EXCHADJUNREALIZED,T1.AMOUNTCUR,T1.AMOUNTMST,
T1.DUEDATE,T1.REFRECID,T1.CASHDISCOUNTLEDGERDIMENSION,T1.CASHDISCDATE,
T1.TRANSDATE,T1.POSSIBLECASHDISC,T1.ACCOUNTNUM,T1.USECASHDISC,T1.LASTINTERESTDATE,T1.SETTLEMENTPRIORITYCASHDISCDATE,T1.REPORTINGCURRENCYAMOUNT,T1.EXCHADJUNREALIZEDREPORTING,T1.TDSAMOUNT_IN,T1.TCSAMOUNT_IN,
T1.INTERESTAMOUNT_BR,T1.FINEAMOUNT_BR,T1.INTERESTCODE_BR,T1.FINECODE_BR,T1.INTERESTAMOUNTPAYMCUR_BR,T1.FINEAMOUNTPAYMCUR_BR,
T1.TAXWITHHOLDAMOUNTORIGIN_IN,T1.SETTLEDLINEPERCENT_IN,T1.SETTLEDTOTALAMOUNT_IN,T1.SKS_EPY_SENTTOEPAY,
T1.COLLECTIONLETTER,T1.COLLECTIONLETTERCODE,T1.DATAAREAID,T1.RECVERSION,T1.PARTITION,T1.RECID,
T2.ACCOUNTNUM,T2.TRANSDATE,T2.VOUCHER,T2.INVOICE,T2.TXT,T2.AMOUNTCUR,T2.SETTLEAMOUNTCUR,T2.AMOUNTMST,T2.SETTLEAMOUNTMST,T2.CURRENCYCODE,T2.DUEDATE,
T2.LASTSETTLEVOUCHER,T2.LASTSETTLEDATE,T2.LASTEXCHADJVOUCHER,T2.CLOSED,T2.TRANSTYPE,T2.APPROVED,T2.EXCHADJUSTMENT,T2.DOCUMENTNUM,T2.DOCUMENTDATE,
T2.LASTEXCHADJRATE,T2.FIXEDEXCHRATE,T2.LASTEXCHADJ,T2.CORRECT,T2.BANKCENTRALBANKPURPOSECODE,T2.BANKCENTRALBANKPURPOSETEXT,T2.SETTLEMENT,
T2.INTEREST,T2.COLLECTIONLETTER,T2.DEFAULTDIMENSION,T2.POSTINGPROFILECLOSE,T2.EXCHRATESECOND,T2.ACCOUNTINGEVENT,T2.EXCHRATE,T2.LASTSETTLEACCOUNTNUM,
T2.COMPANYBANKACCOUNTID,T2.THIRDPARTYBANKACCOUNTID,T2.PAYMMODE,T2.PAYMREFERENCE,T2.PAYMMETHOD,T2.CASHPAYMENT,T2.CONTROLNUM,T2.DELIVERYMODE,T2.POSTINGPROFILE,T2.OFFSETRECID,
T2.EUROTRIANGULATION,T2.ORDERACCOUNT,T2.CASHDISCCODE,T2.PREPAYMENT,T2.PAYMSPEC,T2.CUSTEXCHADJUSTMENTREALIZED,T2.CUSTEXCHADJUSTMENTUNREALIZED,T2.PAYMMANLACKDATE,T2.PAYMMANBATCH,
T2.PAYMID,T2.COLLECTIONLETTERCODE,T2.INVOICEPROJECT,T2.LASTSETTLECOMPANY,T2.CANCELLEDPAYMENT,T2.REASONREFRECID,T2.REPORTINGCURRENCYAMOUNT,
T2.REPORTINGEXCHADJUSTMENTREALIZED,T2.REPORTINGEXCHADJUSTMENTUNREALIZED,T2.LASTEXCHADJRATEREPORTING,T2.REPORTINGCURRENCYCROSSRATE,T2.EXCHADJUSTMENTREPORTING,
T2.SETTLEAMOUNTREPORTING,T2.APPROVER,T2.TAXINVOICESALESID,T2.CONCESSIONCONTRACTID,T2.CONCESSIONSETTLEMENTID,T2.RETAILCUSTTRANS,
T2.RETAILSTOREID,T2.RETAILTERMINALID,T2.RETAILTRANSACTIONID,T2.CUSTBILLINGCLASSIFICATION,T2.MCRPAYMORDERID,T2.DIRECTDEBITMANDATE,T2.PAYMSCHEDID,
T2.SKS_DD_ISDIRECTDEBIT,T2.MODIFIEDDATETIME,T2.DEL_MODIFIEDTIME,T2.MODIFIEDBY,T2.MODIFIEDTRANSACTIONID,T2.CREATEDDATETIME,
T2.DEL_CREATEDTIME,T2.CREATEDBY,T2.CREATEDTRANSACTIONID,T2.DATAAREAID,T2.RECVERSION,T2.PARTITION,T2.RECID,
T3.EXCHADJUNREALIZED,T3.AMOUNTCUR,T3.AMOUNTMST,T3.DUEDATE,T3.REFRECID,T3.CASHDISCOUNTLEDGERDIMENSION,T3.CASHDISCDATE,T3.TRANSDATE,T3.POSSIBLECASHDISC,T3.ACCOUNTNUM,T3.USECASHDISC,T3.LASTINTERESTDATE,T3.SETTLEMENTPRIORITYCASHDISCDATE,
T3.REPORTINGCURRENCYAMOUNT,T3.EXCHADJUNREALIZEDREPORTING,T3.TDSAMOUNT_IN,T3.TCSAMOUNT_IN,T3.INTERESTAMOUNT_BR,T3.FINEAMOUNT_BR,T3.INTERESTCODE_BR,T3.FINECODE_BR,T3.INTERESTAMOUNTPAYMCUR_BR,T3.FINEAMOUNTPAYMCUR_BR,T3.TAXWITHHOLDAMOUNTORIGIN_IN,T3.SETTLEDLINEPERCENT_IN,
T3.SETTLEDTOTALAMOUNT_IN,T3.SKS_EPY_SENTTOEPAY,T3.COLLECTIONLETTER,T3.COLLECTIONLETTERCODE,T3.DATAAREAID,T3.RECVERSION,T3.PARTITION,T3.RECID,
T4.LASTCOLLECTIONLETTERJOURDATE,T4.LASTCOLLECTIONLETTERCODE,T4.LASTCOLLECTIONLETTERNUM,T4.DATAAREAID,T4.RECID,
T5.DISPLAYVALUE,T5.RECVERSION,T5.RECID,
T6.PARTY,T6.DATAAREAID,T6.RECID 
FROM CUSTTRANSOPEN T1 CROSS JOIN CUSTTRANS T2 
CROSS JOIN CUSTTRANSOPEN T3 
LEFT OUTER JOIN CUSTTRANSOPENLASTUPDCOLLECTIONLETTER T4 
ON (((((T4.PARTITION=@P1) AND (T4.DATAAREAID IN (@P2) )) 
AND (T4.PARTITION#2=@P3)) AND (T4.DATAAREAID#2 IN (@P4) )) 
AND (T1.RECID=T4.CUSTTRANSOPENRECID AND (T1.DATAAREAID = T4.DATAAREAID) 
AND (T1.PARTITION = T4.PARTITION))) 
LEFT OUTER JOIN DIMENSIONATTRIBUTEVALUECOMBINATION T5 ON ((T5.PARTITION=@P5) AND (T1.CASHDISCOUNTLEDGERDIMENSION=T5.RECID)) 
CROSS JOIN CUSTTABLE T6 WHERE ((T1.PARTITION=@P6) AND (T1.DATAAREAID IN (@P7) )) AND ((T2.PARTITION=@P8) AND ((((T2.APPROVED=@P9) 
AND 1=@P10) AND (T1.ACCOUNTNUM=T2.ACCOUNTNUM AND (T1.DATAAREAID = T2.DATAAREAID) AND (T1.PARTITION = T2.PARTITION))) 
AND (T1.REFRECID=T2.RECID AND (T1.DATAAREAID = T2.DATAAREAID) AND (T1.PARTITION = T2.PARTITION)))) AND (((T3.PARTITION=@P11) 
AND (T3.DATAAREAID IN (@P12) )) AND ((T1.RECID=T3.RECID AND (T1.DATAAREAID = T3.DATAAREAID) AND (T1.PARTITION = T3.PARTITION)) 
AND (T1.RECID=T3.RECID AND (T1.DATAAREAID = T3.DATAAREAID) AND (T1.PARTITION = T3.PARTITION)))) AND (((T6.PARTITION=@P13) AND (T6.DATAAREAID IN (@P14) )) 
AND ((T6.PARTY=@P15) AND (T2.ACCOUNTNUM=T6.ACCOUNTNUM AND (T2.DATAAREAID = T6.DATAAREAID) AND (T2.PARTITION = T6.PARTITION)))) 
ORDER BY T1.ACCOUNTNUM,T1.AMOUNTCUR,T1.REFRECID,T1.DUEDATE,T3.RECID OPTION(FAST 3)

I have form which include gridview and lookup how can i connect lookup with griview using datasource table purchline purchtable and invent table plzzz help

$
0
0

1) i want gridview empty on form open 

2)when i select id from lookup gridview shows data reltaed to id 

How to change values in drop down list

$
0
0

I am new to Dynamics and D365.

How can I change those values, seen in the screenshot? A screen record is very welcome :)

Thank you, Robert


Unit test: when i run test case , the testcase failed and has a error : FormRun object not initialized, how can i sloved it?

$
0
0

Description: 

TestResults:

Result Message:
An unknown exception caught! (Actual: FormRun object not initialized.

Stack trace

(S)\Classes\FormRun\activate
) - Microsoft.Dynamics.Ax.Xpp.ClrErrorException: ErrorMessageException ---> Microsoft.Dynamics.TestTools.Dispatcher.Exceptions.ErrorMessageException: FormRun object not initialized.

Stack trace

(S)\Classes\FormRun\activate

at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.MessageCenter.ThrowErrorsFromMessageCenter(Object sender, InteractionsProcessingEventArgs args)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.CommunicationManager.ProcessInteractionResults(IEnumerable`1 result)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.CommunicationManager.ProcessInteractions(IEnumerable`1 interactions)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.Form.Close()
at Microsoft.Dynamics.TestTools.Dispatcher.ServerForm.ServerFormDispatcherClientBase.CloseForm(FormState state)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedClient.CloseForm(DispatchedForm form)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedForm.CloseThisForm(Nullable`1 delayMessageCenterValidation)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedForm.Close()
at Dynamics.AX.Application.FormAdaptor.`close(Boolean _delayMessageCenterValidation, Boolean @_delayMessageCenterValidation_IsDefaultSet) in xppSource://Source/TestEssentials\AxClass_FormAdaptor.xpp:line 199
at Dynamics.AX.Application.FormAdaptor.close(Boolean _delayMessageCenterValidation, Boolean @_delayMessageCenterValidation_IsDefaultSet)
at Dynamics.AX.Application.FormAdaptor.close()
at Dynamics.AX.Application.CLICompanyChangeTest.`TestCompanyChange() in xppSource://Source/FoundationTest\AxClass_CLICompanyChangeTest.xpp:line 36
at Dynamics.AX.Application.CLICompanyChangeTest.TestCompanyChange()
at CLICompanyChangeTest::TestCompanyChange(Object , Object[] , Boolean& )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)
--- End of inner exception stack trace ---
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)
at Microsoft.Dynamics.Ax.Xpp.DictClass.Callobject(String _methodName, XppObjectBase _Called, Object[] varArgs)
at Dynamics.AX.Application.SysTest.`invoke(XppObjectBase _object, String _method, Object _optional, Boolean @_optional_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_SysTest.xpp:line 1095
at Dynamics.AX.Application.SysTest.invoke(XppObjectBase _object, String _method, Object _optional, Boolean @_optional_IsDefaultSet)
at Dynamics.AX.Application.SysTest.invoke(XppObjectBase _object, String _method)
at Dynamics.AX.Application.SysTest.`doRunTestMethod(SysTestResult _result) in xppSource://Source/ApplicationFoundation\AxClass_SysTest.xpp:line 719

Infolog Messages:
<error>FormRun object not initialized.

Stack trace

(S)\Classes\FormRun\activate<\error>
<error>FormRun object not initialized.

Stack trace

(S)\Classes\FormRun\activate<\error>
<error>at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.MessageCenter.ThrowErrorsFromMessageCenter(Object sender, InteractionsProcessingEventArgs args)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.CommunicationManager.ProcessInteractionResults(IEnumerable`1 result)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.CommunicationManager.ProcessInteractions(IEnumerable`1 interactions)
at Microsoft.Dynamics.Client.ServerForm.AutomationLayer.Form.Close()
at Microsoft.Dynamics.TestTools.Dispatcher.ServerForm.ServerFormDispatcherClientBase.CloseForm(FormState state)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedClient.CloseForm(DispatchedForm form)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedForm.CloseThisForm(Nullable`1 delayMessageCenterValidation)
at Microsoft.Dynamics.TestTools.Dispatcher.Client.DispatchedForm.Close()
at Dynamics.AX.Application.FormAdaptor.`close(Boolean _delayMessageCenterValidation, Boolean @_delayMessageCenterValidation_IsDefaultSet) in xppSource://Source/TestEssentials\AxClass_FormAdaptor.xpp:line 199
at Dynamics.AX.Application.FormAdaptor.close(Boolean _delayMessageCenterValidation, Boolean @_delayMessageCenterValidation_IsDefaultSet)
at Dynamics.AX.Application.FormAdaptor.close()
at Dynamics.AX.Application.CLICompanyChangeTest.`TestCompanyChange() in xppSource://Source/FoundationTest\AxClass_CLICompanyChangeTest.xpp:line 36
at Dynamics.AX.Application.CLICompanyChangeTest.TestCompanyChange()
at CLICompanyChangeTest::TestCompanyChange(Object , Object[] , Boolean& )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)<\error>

How to use lookup form in UI Builder and get RecId

$
0
0

This is my UI Builder

Is it possible to get the RecID of this?

Contract

[
DataContractAttribute,
SysOperationContractProcessingAttribute(classstr(AnnualBudgetUIBuilder))
]
class AnnualBudgetContract
{
    BudgetCycleName                 budgetCycle;

    [
         DataMemberAttribute('BudgetCycleName'),
        SysOperationLabel('Budget Cycle')
    ]
    public BudgetCycleName parmBudgetCycle(BudgetCycleName _budgetCycle = budgetCycle)
    {
        budgetCycle = _budgetCycle;
        return budgetCycle;
    }

}

UI Builder

class AnnualBudgetUIBuilder  extends SysOperationAutomaticUIBuilder
{
    AnnualBudgetContract contract;
    DialogField dialogBudgetCycle;

    public void build()
    {
        DialogGroup dlgGrp;

        //get the current dialog
        Dialog      dlg			= this.dialog();
        dlgGrp					= dlg.addGroup("");
        dlgGrp.columns(2);
        contract				= this.dataContractObject();
        dialogBudgetCycle       = this.addDialogField(methodStr(AnnualBudgetContract, parmBudgetCycle), contract);

    }

    public void postBuild()
    {
        super();
        dialogBudgetCycle.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(AnnualBudgetUIBuilder, budgetCycleLookup), this);
        dialogBudgetCycle.registerOverrideMethod(methodStr((FormStringControl, modified), methodStr(AnnualBudgetUIBuilder, budgetCycleModified), this);
    }


    private void budgetCycleLookup(FormStringControl _lookup)
    {
        Query query = new Query();
        QueryBuildDataSource qbds;
        SysTableLookup sysTableLookup;

        if(_lookup != null)
        {
            sysTableLookup = SysTableLookup::newParameters(tableNum(BudgetCycle), _lookup);
             
            qbds = query.addDataSource(tableNum(BudgetCycle));

            qbds.addSortField(FieldNum(BudgetCycle, Name),SortOrder::Ascending);

            qbds.fields().addField(fieldNum(BudgetCycle, StartFiscalCalendarPeriod));
            qbds.fields().addField(fieldNum(BudgetCycle, EndFiscalCalendarPeriod));

            //sysTableLookup.addLookupField(fieldNum(BudgetCycle, RecId), True);
            sysTableLookup.addLookupField(fieldNum(BudgetCycle, Name), True);
            sysTableLookup.addLookupMethod(tableMethodStr(BudgetCycle, editCycleStartDate));
            sysTableLookup.addLookupMethod(tableMethodStr(BudgetCycle, editCycleEndDate));
            sysTableLookup.parmUseLookupValue(false);

            sysTableLookup.parmQuery(query);
            sysTableLookup.performFormLookup();
            
        }
    }

    public boolean budgetCycleModified(FormStringControl _budgetCycle)
    {
        boolean ret = false;
        BudgetCycle budgetCycle;

        if(dialogBudgetCycle.value())
        {
            info(strFmt("%1", dialogBudgetCycle.value()));
            ret = true;
        }
        return ret;
    }

}

I saw this post from stackoverflow and that's why I'm asking how to use lookup form in the UI Builder. Am I on the right track?
https://stackoverflow.com/questions/33369015/how-to-get-recid-selected-from-lookup-method

display method for date against itemid

$
0
0

Dear Experts,

I want to show Restest (same logic to manufacturing date or expiry date) against Item Number, right now we have manufacturing date and expiry date against the batch number.What will be the exact code. In above image i have given all code and datasource used for it, please check the above image. thanks in advance

Best Regards,

Shabir Ahmad

Error on data import

$
0
0

error message showing while importing data with the help of stagging

Visual Studio "Model" is grayed out in Build Models Menu after manual import of a deployable package.

$
0
0


I have manually applied a deployable package on a VM following this https://ax.help.dynamics.com/en/wiki/installing-deployable-package-in-ax7/

The package elements were successfully imported and I can see the package model and elements in classic/model view of AOT.

But all elements show up in italic font and in the Build Models menu the related package model is grayed out (check-box to select for build disabled). Can anyone please guide me on what am I missing or what do I need to do next??

how to check if an object is formContainerControl?

$
0
0

I want to verify if object is formContainerControl.

I add this code But I didn't get any result:

object _formContainer;
if(_formContainer is FormContainerControl)
            {
                ret=true;
                info("Container");
                return ret;
            }

Exception in batch


about events in d365fo

$
0
0

Hi,

i wish to know event in d365fo, it has more are there ,i want form,datasource, control design events and also definition where,when,why we using this.

i want particularly(on leaving record,on left record, onmarkchanged,onpostlinkactive,onquery executed,onrefreshed,onreread,on selection changed,on validated delete,on validating delete,on validating write,onwriting,onwritten).

i mentioned above events definition example are not there in google clearly. i want not only above mentioned ,i want to know all the events definition where,when,why we using this.

THANK YOU..

How to select characters inside a field (String)

$
0
0

Hi guys!

I had job to update this field that will include new emails, now the new requirement is I have to delete some of those email names but confronted with this issue, since those emails on one field only (type is String), how do I select this field logicaly? kindly see my example below, 

email name to delete: john@example.com

example record1: james@exampe.com;john@example.com;fox@example.com

example record2: john@example.com;james@example.com;fox@example.com

your help guys is much appreciated, Thank you!

Getting an added Menu Item Button on an Extension to Work

$
0
0

I've done an extension on a form. I've added a Menu Item Button. I can't add any methods in the extension, so I created a class for COC. Code snippet:

[ExtensionOf(formStr(InventItemPrice))]
final class InventItemPrice_Extension
{
private xFormRun element;

[FormControlEventHandler(formControlStr(InventItemPrice, BOMCostRoll), FormControlEventType::Clicked)]
public static void BOMCostRoll_OnClicked(FormControl sender, FormControlEventArgs e)
{
}

I copied the event handler for OnClicked and pasted it into the code, see above. When I right mouse click on OnClicked and select Find References, I get the above link. When I run the form and click on the Menu Item Button, I get No object specified on menu item. Why?

I very new to D365 X++, so please excuse my ignorance. I appreciate any help.

How to get property menuItem from ControlContainer?

$
0
0

Hi ,

I want to get the property menuItem from controlContainer:

I add this code :

    if(_axFormControl.Type==Microsoft.Dynamics.AX.Metadata.Core.MetaModel.FormControlType::Container)
       {    
            // this I want to get the propertyMenuItem
       }

I noticed that : when  I open form from AOT , I don't see the property menuItemName:

But when I open form designer I see it:

It's possible to get this property?

Export data to csv x++

$
0
0

Hello everyone,

I am working in Dynamics 2012, trying to export some data in CSV format.

What I am trying to do is to export data of Field1 from TableA. Field1 is of type string, size 10. The problem is that one of the values that contains Field1 is  6549030E82 and when i open it in csv(excel) it is saved as scientific, as in the image here.  

What I want is that when I open  the file, to be shown as 6549030E82. 

To achieve this I have tried, both the following scenarios, but both of them show the scientific value. 

Scenario1.

public void exportCSV()
{
#File
commaIO commaIO;
FileIOPermission permission;

Table tableA;
container record;

permission = new FileIOPermission(fileName,'RW');
permission.assert();

commaIO = new commaIO(fileName,'W');
commaIO.outFieldDelimiter(';');

commaIO.write("@MIS95","@SYS59532","@SYS80949", 'line');


while select tableA
{
record = [tableA.Field1];
commaIO.writeExp(record);
}
CodeAccessPermission::revertAssert();
}

Scenario 2

public void exportExcel()
{

FileIOPermission fioPermission;
SysExcelApplication application;
SysExcelWorkBooks workBooks;
SysExcelWorkBook workBook;
SysExcelWorkSheet workSheet;
SysExcelCells cells;

int i;

application = SysExcelApplication::construct();
workBooks = application.workbooks();
workBook = workBooks.add();
workSheet = workBook.worksheets().itemFromNum(1);
cells = worksheet.cells();


while select TableA
{
cells.item(i,1).value(TableA.Field1);
i++;
}

workSheet .columns().autoFit();
application.displayAlerts(false);
workbook.saveAs(filename, 6);
workbook.comObject().save();
workbook.saved(true);
application.quit();
}

In the above scenario, I have even tried to format the whole excel column cell.range('A1:A100').NumberFormat('  ');, but it ignores the value 6549030E82 and shows empty cell. 

Can anyone suggest something in order to show the right value, i mean to show the string value and not convert it to scientific format. . I can use any of the scenarios, it is important to show the right value. 

Thanks in advance.

Viewing all 17532 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>