web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Electronic Reporting error – “Parameters for model Customer Label have not been found”

(0) ShareShare
ReportReport
Posted on by 269
 Hi @Fernitudela , 
    
     I had gone through some of your videos regarding 'Electronic Reporting' in d365 fo . I am trying to do a Electronic report but I'm getting an error.

I’m working on a custom Electronic Reporting (ER) format that I’m triggering from X++ using a service, controller, and contract class. The report should receive user input parameters (ItemId and InventBatchId) from the contract and pass them to the ER model mapping at runtime. This Electronic report is triggered through a 'custom button' from batches form in d365 fo . Is there anything I'm missing in the setup or configuration or in code level.

 But I am getting this error continuously that '“Parameters for model Customer Label(my model name) have not been found" .
 
 
[DataContract]
public class IIT_PrintCustomerLabelERContract extends ERFormatMappingRunBaseContract
{
    ItemId          itemId;
    InventBatchId   inventBatchId;
    [DataMemberAttribute("Item Id")]
    public ItemId parmItemId(ItemId _itemId = itemId)
    {
        itemId = _itemId;
        return itemId;
    }
    [DataMemberAttribute("Batch Id")]
    public InventBatchId parmInventBatchId(InventBatchId _inventBatchId = inventBatchId)
    {
        inventBatchId = _inventBatchId;
        return inventBatchId;
    }
}

Service class code 
 
using Microsoft.Dynamics365.LocalizationFramework;
class IIT_PrintCustomerLabelERService extends SysOperationServiceBase
{
    public const str ERModelDataSourceName = 'Customer Label';
    public const str DefaultExportedFileName = 'Stadler Customer Label Report';
    public const str ParametersDataSourceName = 'User input parameters';
    public static ERFormatMappingId getFormatMapping()
    {
        return (select ERFormatMappingTable where ERFormatMappingTable.Name == 'Stadler Part1').RecId;
    }
    public void executeOperation(IIT_PrintCustomerLabelERContract _contract)
    {
        ERFormatMappingId formatMappingId;
        formatMappingId = IIT_PrintCustomerLabelERService::getFormatMapping();
        if(formatMappingId)
        {
            try
            {
                ERIModelDefinitionParamsAction parameters = new ERModelDefinitionParamsUIActionComposite().add(new ERModelDefinitionObjectParameterAction(ERModelDataSourceName, ParametersDataSourceName, _contract, true));
                ERIFormatMappingRun formatMappingRun = ERObjectsFactory::createFormatMappingRunByFormatMappingId(formatMappingId);
                formatMappingRun.withParameter(parameters);
                formatMappingRun.parmFileName(DefaultExportedFileName);
                formatMappingRun.withFileDestination(_contract.getFileDestination());
                formatMappingRun.parmShowPromptDialog(false);
                formatMappingRun.run();
            }
            catch
            {
                error("An error occurs while generating the report");
            }
        }
        else
        {
            Warning("No format mapping found");
        }
    }
}

Controller 
 
class IIT_PrintCustomerLabelERController extends ERFormatMappingRunBaseController
{
    public static void main(Args args)
    {
        IIT_PrintCustomerLabelERController operation;
        IIT_PrintCustomerLabelERContract   contract;
        operation = new IIT_PrintCustomerLabelERController(classStr(IIT_PrintCustomerLabelERService), methodStr(IIT_PrintCustomerLabelERService, executeOperation), SysOperationExecutionMode::Synchronous);
        contract = operation.getDataContractObject();
        operation.parmShowDialog(true);
        operation.startOperation();
    }
    public ClassDescription defaultCaption()
    {
        ClassDescription batchDescription;
        batchDescription = "Customer label ER Report";
        return batchDescription;
    }
}
Please guide me on this .
Regards,
Charan.
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 753

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 752 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 534 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans