Skip to main content
Community site session details

Community site session details

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

Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts

(1) ShareShare
ReportReport
Posted on by
Hi,
I am currently facing an issue after adding my customization in Copilot Studio through Microsoft D365 F&O. I have added code that returns unposted journals by a specific date range (which will be provided by the user through Copilot Sidecar in the D365 F&O environment). After deploying my code, I am facing an issue where, upon opening the Copilot Sidecar, an error pops up.

Moreover, my previous customizations that worked fine before deploying are also not working. Additionally, the default prompts like "What can Copilot do?" sometimes respond with "Sorry, I don't know that one yet, but I'm always learning." Other times, they only respond after refreshing 4 to 5 times.

Is there any way to debug this via Visual Studio or through Copilot Studio?

  • H.Hassan Profile Picture
    on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    ,
    Hi Viswanath,

    Yes, I have resolved this issue.

    I was facing this issue due to the input parameter I used in X++. The data type I had been using was date (TransDate). After changing this data type to string, the error was resolved.

     

    Previous Code (using TransDate)

        private TransDate startDate; 
        private TransDate endDate; 
        private List  unpostedJournals;

      
        //Input parameter that is received from Copilot Studio.
        [DataMember('startDate'),
            SysCopilotChatActionInputParameter('Start date for the period.', true)]
        public TransDate parmStartDate(TransDate _startDate = startDate)
        {
            startDate = _startDate;
            return startDate;
        }
        //Input parameter that is received from Copilot Studio.
        [DataMember('endDate'),
            SysCopilotChatActionInputParameter('End date for the period.', true)]
        public TransDate parmEndDate(TransDate _endDate = endDate)
        {
            endDate = _endDate;
            return endDate;
        }

    Resolved by changing the data type to string:
     
        private str startDate; 
        private str endDate; 
        private List  unpostedJournals;

      
        //Input parameter that is received from Copilot Studio.
        [DataMember('startDate'),
            SysCopilotChatActionInputParameter('Start date for the period.', true)]
        public str parmStartDate(str _startDate = startDate)
        {
            startDate = _startDate;
            return startDate;
        }
        //Input parameter that is received from Copilot Studio.
        [DataMember('endDate'),
            SysCopilotChatActionInputParameter('End date for the period.', true)]
        public str parmEndDate(str _endDate = endDate)
        {
            endDate = _endDate;
            return endDate;
        }

     
  • Viswanath M Profile Picture
    on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    I have same issues.
    Did you solve this error.
  • André Arnaud de Calavon Profile Picture
    295,143 Super User 2025 Season 1 on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    Hi,
     
    In Copilot Studio, you can go to the Settings. Then on the Copilot Details, you can open the Advanced tab page. Here you can set up a connection string to application insights. Telemetry will then be sent to Application insights where you can check for possible details about your issue.
  • H.Hassan Profile Picture
    on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts

    André Arnaud, I checked my code by adding it in a runnable class and then retrieving data via info. It is giving me the correct answer. However, when I deployed it and opened Copilot Sidecar, this error popped up, and the screen became almost unresponsive. Since I deployed it, I can't find a way to debug this.

    Could you tell me any way to debug this issue via Copilot Studio or D365 F&O? Is there any way to find where logs have been saved?

  • André Arnaud de Calavon Profile Picture
    295,143 Super User 2025 Season 1 on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    Hi,

    I have seen a similar error showing up sometimes in my sandbox but not directly when opening the sidecar. I have some Copilot X++ extensions running as well. I'm planning for another one soon where I think I also need an output parameter which I have not used in the current ones. 
    Have you tried debugging the code to see what exactly is causing this error in your environment?
  • H.Hassan Profile Picture
    on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    Hi André Arnaud,
    Thanks for your reply,
    I implemented two classes and Action Menu Item in X++.

    1 CFZUnpostedJournalsByDateRange class
    2 CFZUnpostedJournal class
    3 CFZUnpostedJournalsByDateRange ActionMenuItem
    /// <summary>
    /// The CFZUnpostedJournalsByDateRange class defines a Copilot action in Dynamics 365 Finance and Operations (D365 F&O) that
    /// retrieves unposted journal data within a specified date range.
    /// It allows users to view unposted journals through Copilot Studio.
    /// </summary>
    [DataContract]
    [SysCopilotChatGlobalAction]
    [SysCopilotChatActionDefinition(
        'MS.PA.RA.Copilot.CFZUnpostedJournalsByDateRange', // Identifier starting with "MS.PA"
    'Show unposted journals by specified Date Range', // Name for the copilot action
    'Present user with unposted journals for the provided date range', // Description for the Action
    menuItemActionStr(CFZUnpostedJournalsByDateRange), MenuItemType::Action)] // Secured by Menu Item
    public class CFZUnpostedJournalsByDateRange extends SysCopilotChatAction
    {
        private TransDate startDate; 
        private TransDate endDate; 
        private List  unpostedJournals;

      
        //Input parameter that is received from Copilot Studio.
        [DataMember('startDate'),
            SysCopilotChatActionInputParameter('Start date for the period.', true)]
        public TransDate parmStartDate(TransDate _startDate = startDate)
        {
            startDate = _startDate;
            return startDate;
        }
        //Input parameter that is received from Copilot Studio.
        [DataMember('endDate'),
            SysCopilotChatActionInputParameter('End date for the period.', true)]
        public TransDate parmEndDate(TransDate _endDate = endDate)
        {
            endDate = _endDate;
            return endDate;
        }
        //Output parameter, that is received by Copilot Studio once the action is executed.
        [DataMember('unpostedJournals'),
            SysCopilotChatActionOutputParameter('List of unposted journals')]
        public List parmUnpostedJournals(List _unpostedJournals = unpostedJournals)
        {
            unpostedJournals = _unpostedJournals;
            return unpostedJournals;
        }
        /// <summary>
        /// This method retrieves unposted journal data from Dynamics 365 Finance and Operations within a specified 
        /// date range and prepares it to be used as output in a Copilot action.
        /// </summary>
        /// <param name = "_actionDefinition">A parameter of type SysCopilotChatActionDefinitionAttribute, representing the definition of the action to be executed by the Copilot.</param>
        /// <param name = "_executionContext">An object parameter representing the context in which the action is being executed.</param>
        public void executeAction(SysCopilotChatActionDefinitionAttribute _actionDefinition, Object _executionContext)
        {
            LedgerJournalTable ledgerJournalTable;
            LedgerJournalTrans ledgerJournalTrans;
            // Fetch start and end dates from parameters
            TransDate fromDate = this.parmStartDate();
            TransDate toDate = this.parmEndDate();
            List  unpostedJournalsList = new List(Types::Class);
            if (fromDate && toDate)
            {
                // Fetch unposted journals within the specified date range
                while select *
                    from ledgerJournalTable
                    group by
                    ledgerJournalTable.JournalNum,
                    ledgerJournalTable.JournalName,
                    ledgerJournalTable.Name,
                    ledgerJournalTrans.TransDate
                    
                    join ledgerJournalTrans
                    where ledgerJournalTable.JournalNum == ledgerJournalTrans.JournalNum
                    && ledgerJournalTable.Posted == NoYes::No
                    && ledgerJournalTrans.TransDate >= fromDate
                    && ledgerJournalTrans.TransDate <= toDate
                    {
                    // Create a new CFZUnpostedJournal object for each record
                    CFZUnpostedJournal unpostedJournal = new CFZUnpostedJournal();
                       
                    unpostedJournal.setCFZUnpostedJournal(
                    ledgerJournalTable.JournalNum,
                    ledgerJournalTable.JournalName,
                    ledgerJournalTable.Name,
                    ledgerJournalTrans.TransDate
                    );
                    unpostedJournalsList.addEnd(unpostedJournal);
                }
                // Set the list of unposted journals as output parameter
                this.parmUnpostedJournals(unpostedJournalsList);
            }
            else
            {
                // Handle error if dates are not provided
                error('@CFZCopilotLabels:ERRProvideDateRange');
            }
        }
    }




     
    /// <summary>
    /// Represents an unposted journal entry with details such as journal number, name, description, and transaction date. 
    /// </summary>
    public class CFZUnpostedJournal
    {
        // Data members (properties)
        public str JournalNum;
       public  str JournalName;
       public str Description;
       public TransDate TransDate;
        
        public  void setCFZUnpostedJournal(str _journalNum, str _journalName, str _description, TransDate _transDate)
        {
            JournalNum = _journalNum;
            JournalName = _journalName;
            Description = _description;
            TransDate = _transDate;
        }
    }

     
  • H.Hassan Profile Picture
    on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    Hi Hana Xue,
    Thanks for your reply,
    I have checked this method, but I am still facing the same issue. This did not resolve my problem.
  • André Arnaud de Calavon Profile Picture
    295,143 Super User 2025 Season 1 on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts
    Hi,
     
    Can you share details of what and how you extended Copilot Studio? Did you add X++ coding as a plugin?
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Issues with Customization Deployment in Copilot Studio Affecting Functionality and Default Prompts

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans