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 :
Microsoft Dynamics AX (Archived)

RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

(0) ShareShare
ReportReport
Posted on by 1,575

Hi there,

I was trying search customers operation in AX 2012 R2 Retail POS.  Got Got Error Number: 1002 An error occurred in the operation.

LSRetailPosis.POSProcesses.CustomerSearch: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'DBO.CUSTOMERSEARCH'.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at LSRetailPosis.ApplicationFramework.POSShowForm(Form theForm)
   at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search()
   at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search(IPosTransaction posTransaction)
   at LSRetailPosis.POSProcesses.CustomerSearch.Execute()
ClientConnectionId:3e7d8b10-e9dd-40e6-a464-b30937908d50.

what's DBO.CUSTOMERSEARCH?  I cannot find it in AxRetailPOS database.  I don't see it in AX2012 POS as well.  is it a new feature in AX 2012 R2 Retail POS?

other operations are ok.  I can add a new customer in POS, and see the customer in AX.

Thanks,

Alan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Feng Zhou Profile Picture
    1,575 on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    fixed by database utlity

  • Community Member Profile Picture
    on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    fixed by database utlity.

    I didn't understand what do we have to do with database utility. When i am adding the customer to the transaction it gives me the following error. Error Number 1002: Occurred in the transaction. If i go into event viewer if shows me the following 2 error messages. Please assist me.

    1)-------------------

    LSRetailPosis.POSProcesses.CustomerSearch: System.InvalidOperationException: Sequence contains more than one element

      at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)

      at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)

      at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)

      at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)

      at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)

      at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetElectronicAddressesForLocation(Int64 locationId)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.SetCustomerPostalAddress(Customer customer, PostalAddress postalAddress)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetTransactionalCustomer(String accountNumber)

      at LSRetailPosis.BusinessLogic.CustomerSystem.GetCustomerInfo(String customerId)

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search()

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search(IPosTransaction posTransaction)

      at LSRetailPosis.POSProcesses.CustomerSearch.Execute().

    2).----------------------------

    LSRetailPosis.POSProcesses.POSProcessThread: System.InvalidOperationException: Sequence contains more than one element

      at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)

      at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)

      at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)

      at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)

      at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)

      at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetElectronicAddressesForLocation(Int64 locationId)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.SetCustomerPostalAddress(Customer customer, PostalAddress postalAddress)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetTransactionalCustomer(String accountNumber)

      at LSRetailPosis.BusinessLogic.CustomerSystem.GetCustomerInfo(String customerId)

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search()

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search(IPosTransaction posTransaction)

      at LSRetailPosis.POSProcesses.CustomerSearch.Execute()

      at LSRetailPosis.POSProcesses.Operation.RunOperation()

      at LSRetailPosis.POSProcesses.POSProcessThread.ThreadProc().

  • Community Member Profile Picture
    on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    fixed by database utlity.

    I didn't understand what do we have to do with database utility. When i am adding the customer to the transaction it gives me the following error. Error Number 1002: Occurred in the transaction. If i go into event viewer if shows me the following 2 error messages. Please assist me.

    1)-------------------

    LSRetailPosis.POSProcesses.CustomerSearch: System.InvalidOperationException: Sequence contains more than one element

      at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)

      at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)

      at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)

      at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)

      at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)

      at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetElectronicAddressesForLocation(Int64 locationId)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.SetCustomerPostalAddress(Customer customer, PostalAddress postalAddress)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetTransactionalCustomer(String accountNumber)

      at LSRetailPosis.BusinessLogic.CustomerSystem.GetCustomerInfo(String customerId)

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search()

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search(IPosTransaction posTransaction)

      at LSRetailPosis.POSProcesses.CustomerSearch.Execute().

    2).----------------------------

    LSRetailPosis.POSProcesses.POSProcessThread: System.InvalidOperationException: Sequence contains more than one element

      at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)

      at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)

      at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)

      at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)

      at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)

      at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetElectronicAddressesForLocation(Int64 locationId)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.SetCustomerPostalAddress(Customer customer, PostalAddress postalAddress)

      at Microsoft.Dynamics.Retail.Pos.DataManager.CustomerDataManager.GetTransactionalCustomer(String accountNumber)

      at LSRetailPosis.BusinessLogic.CustomerSystem.GetCustomerInfo(String customerId)

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search()

      at Microsoft.Dynamics.Retail.Pos.Customer.Customer.Search(IPosTransaction posTransaction)

      at LSRetailPosis.POSProcesses.CustomerSearch.Execute()

      at LSRetailPosis.POSProcesses.Operation.RunOperation()

      at LSRetailPosis.POSProcesses.POSProcessThread.ThreadProc().

  • Feng Zhou Profile Picture
    1,575 on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    Hi  VENUGOPALREDDY,

    My problem is the store database was somehow disrupt, lost some stored procedures.  So I ran the database utility to fix it.

    Your problem looks is data issue.  Did you try to re-run N job to replicate customers from AX to store db again?

  • Community Member Profile Picture
    on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    Hi  Feng Zhou,

    Thank you very much for your answer.

    I run N-Job every night but it doesn't make any difference. I am debugging to see where it is really getting error, the error coming in the following like in Customer.cs class

    return this.CustomerSystem.GetCustomerInfo(selectedCustomerId);

    It ispassing the correct customerID but the result comes as null. As I can't see what is happening in the GetCustomerInfo Method. I am really stuck. Please assist me.

    You saying run the database utility, but as far as I know it is for the creation of database. If I create the new database using the utility what is gonna happen to the transactions which are already there in the existing database. do we have any way to get al the sp's without loosing the data there in the existing database?

  • Feng Zhou Profile Picture
    1,575 on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    Like after applied hotfix, you can run the database utility to update the POS database. It won't delete your existing data.

    Did you do anything code change or hotfix apply?

  • Suggested answer
    Praveen Profile Picture
    1,201 on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    Yes, as per the Fenh Zhou;s comment can you check if this issue is happening only on one POS or on others too. Did you perform any updates or hotfix? If you can narrow the issue it should be easier to troubleshoot. Sometimes I have faced some issues which just vanishes when you remove, re-install and update Database utility to update the corrupted references or stored procedures.

  • Community Member Profile Picture
    on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    My Problem is not resolved yet.  

    Yesterday I have replicated all the customer's down to the POS database but it has not helped me.

    I am getting the above mentioned error for only few customers.

    I have created new empty database and compared with live database it has all the objects(Sp's, views, etc..) correctly in live.  

    I have not made any code changes.

    Do you want me to run the database utility by just pointing to the existing Live working database in the Store?

  • Community Member Profile Picture
    on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    Hi Praveen,

    First thing is, it is giving the error only for few customer accounts.  The error is coming in all the stores for those customer accounts.

  • Feng Zhou Profile Picture
    1,575 on at
    RE: AX2012 R2 RetailPOS, Search Customers Got Error Number: 1002 An error occurred in the operation.

    duplicate customers in database?  try to run customer related N job.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans