Question

How to delete customer salesperson based on Salesperson ID and Location ID

  • 12 October 2023
  • 5 replies
  • 157 views

Userlevel 5
Badge +1

Say a customer record has multiple salespersons assigned to the same Location ID (on the Salespersons tab).

Is it possible to configure an import scenario to delete a specific line based on BOTH the Salesperson ID and the Location ID?

Example:

Salesperson A // Location A

Salesperson B // Location A

Salesperson C // Location A

Salesperson A // Location B

Salesperson B // Location B

Salesperson C // Location B

 

If I wanted to delete the Salesperson B // Location B line from the Salespersons tab, how would I configure an import scenario to do so?


5 replies

Userlevel 7
Badge +12

hI @Evan G 

I have configured the sales person in One location

 

Using import scenario I have deleted the sales person

Attached sample file and xml

Userlevel 2

Hello @mikeho,
This should be possible using a few import scenario techniques that aren’t always apparent in the dropdown lists.  You can select a specific line from a table by using @@FieldName =[specific_value] instead of selecting by line number. Then you are be able to delete that line using <Line Number> =-2 since Acumatica allows using the + (Add Row) and x (Delete Row) actions on a table with -1 and -2 respectively.

For example let’s say we would like to remove the 3rd line (House Account / South Office combination) from this Customer’s Salespersons tab
 

But we don’t want to hard code the Import Scenario to use <Line Number> =3.  We can instead specify in the Field / Action Name column @@SalesPersonID and @@LocationID to bring up the key fields and then delete that specific line from the table with <Line Number> = -2.
 


 

Userlevel 5
Badge +1

@manikantad18 - thank you, but it looks like your import scenario example is just going off of the Salesperson ID and not dependent on the Location ID as well. (For example, if I have multiple lines with t same Salesperson ID, but I only want to delete a specific line based on the Location ID, your import scenario does not do that.)

@jturcotte - thank you! I did not realize I could use the <Key: ___> fields in this way. 

 

As a related question, though - is it possible to skip a delete step if a field is not found or is null? Here’s what I’m trying to accomplish:

  • I have a UDF selector for the Salesperson ID
  • I want to be able to set this UDF for the customer record and have the default salesperson  (on the Salespersons tab) change for all of the active locations on a customer record to match.
  • I also need for any new locations added to the customer record to automatically be added to the Salespersons tab with the Salesperson ID matching the salesperson designated in the UDF

I have a GI to show any discrepancies where the UDF does not match any lines on the Salespersons tab OR where there is an active location on the customer account that is not on the Salespersons tab. I have the below import scenario based on the GI results:

 

And I have a business event created that is set to trigger this import scenario when any records are added to the GI.

This process works flawlessly with lines that exist on the Salespersons tab; if the default salesperson on those lines matches the UDF, and then you change the salesperson in the UDF, all of the lines are changed to match in the Salespersons tab. 

However, if a location is added to the customer account, the location shows on the GI but the business event fails with this error message:

0 records of 1 have been processed. The last error was An error occurred during processing of the field Location ID: Error: 'Location ID' cannot be found in the system.

 

That said, if I run the import scenario manually it DOES add the new location to the Salespersons tab with the Salesperson ID set to match the UDF.

Any suggestions on how to get this process to work?

Userlevel 7
Badge

Hi @mikeho were you able to find a solution? Thank you!

Userlevel 5
Badge +1

Hi @Chris Hackett - no, I haven’t found a solution yet.

Still hoping @manikantad18 or @jturcotte will have suggestions for me!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved