Hi,
1. I am customizing XYZ Form. I want to initialize few fields based on newly created custom field.
2. I want to call my custom form method 'myUpdateDesign()' which I have created in Extension class of XYZ form to update design. I created the event handler of 'onModified()' method. I have initialized the FormRun object and trying to call form methods.
[SuppressBPWarning('BPParameterNotUsed', 'Parameter e required in signature'), FormDataFieldEventHandler(formDataFieldStr(XYZ, myDb, myField), FormDataFieldEventType::Modified)] public static void myField_OnModified(FormDataObject sender, FormDataFieldEventArgs e) { FormDataObject caller = sender as FormDataObject; FormRun formRun = caller.dataSource().formRun(); FormDataSource myDB_ds = caller.dataSource().formRun().dataSource(formDataSourceStr(XYZ,myDB)); AVAProjGrant myDB = myDB_ds.cursor(); if(myDB.myField == NoYes::Yes) { formRun.myUpdateDesign(false); } }
3. It is working but I'm getting below mention BPRule error
BP Rule: [BPUpgradeCodeLateBoundCall:A late bound call formRun.avaUpdateDesignExRateTab is made. In source system (AX 2012) it is possible to dynamically call methods where the number and type of the parameters does not match with the method definition. This is not supported in AX 7, where the number and types of parameters have to match. Even if the parameters do match, the late bound call is extremely expensive. Mitigation: Use a class or interface hierarchy to provide a type safe fast call, or use the IS and AS operators to cast to a known type before calling.
Can you please help me how can I use my custom form methods without BP warning?
Thanks in advance!
Regards,
Aimon Fatima