Skip to main content
Solved

Modify Sales Order Detail with an Import Scenario


abrunner78
Jr Varsity III
Forum|alt.badge.img

Hi Everyone, 

I’m trying to figure out how to use an Import Scenario to modify the Sales Order Detail section. To be more specific, when we issue a warranty with a receipt line I would like to add a not to the issue lines saying, “Please include a return label”. Since this note will appear on the pick list our warehouse team will see it and can take action.

Another way I thought of and would would be happy to resolve this is to use the import scenario to add a ‘return label’ non-stock line item. We could set this to $0.00 and as long as it is an ‘issue’ it should appear on the pick list. 

Below is what I have so far. The problem is I get this error when it tries to run, “The last error was IN Error: Unit conversion  is missing.”

 Looking forward to see what everyone has to say. 

Best answer by abrunner78

@Naveen B, I was able to figure it out. 

  1. Thanks to your help I was able to get the Import Scenario working. Thanks again. 
  2. The Business Event was failing because all of the key fields need to be in the Results Grid; I was missing SOLine.LineNbr. 

@Irina documented this on “How to configure a business event to trigger for each line on the generic inquiry

Suppose that you need to set up a business event that will trigger for each detail line of the sales order. The same approach can be used for any other document in the system.

Step 1: When setting up the generic inquiry intended to use for business events, it is important to make sure that all the key fields are added to the Results Grid tab.

For example, for the PX.Objects.SO.SOLine table, it is important to make sure that LineNbr is included, otherwise, it will only trigger once for the whole order unless the order is saved after each line is entered.

 

Having this understanding moving forward is going to be really powerful for us. Thank you to both of you.  

View original
Did this topic help you find an answer to your question?

20 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • August 23, 2021

Hi @abrunner78  I just worked on this import scenario and I can able to update the NOTE Text at Sales Order document details. Please find the Import Scenario screenshots for reference.

 

 


abrunner78
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 40 replies
  • August 23, 2021

@Naveen B I was able to get the whole thing to partially work. 

  1. I had to remove the @@InventoryID line from the Import Scenario. What is the purpose of that?

     

  2. When I try to have multiple different part numbers in a single order the Business Event wont ever trigger. 
  3. I wasn’t been able to successfully use the Source Restriction to make sure the note only applies to the Issue items. 

 -Adam


abrunner78
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 40 replies
  • August 24, 2021

@Naveen B I have been digging deeper into Import Scenarios and have a better idea of what the @@InventoryID was for. I was able to add it back in and things are working well. 

After some testing the Import Scenario is working as intended, but the Business Event still isn’t. The problem is “More than one inserted or deleted row matched’
 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • August 24, 2021

HI @abrunner78    I never worked on Import Scenario using Business events. I need to spend sometime to learn this.

Just FYI...basically, @@InventoryID is used to search for a detail line by the value of the SKU and based on this KEY field system will update the Document Line.

 


abrunner78
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 40 replies
  • Answer
  • August 24, 2021

@Naveen B, I was able to figure it out. 

  1. Thanks to your help I was able to get the Import Scenario working. Thanks again. 
  2. The Business Event was failing because all of the key fields need to be in the Results Grid; I was missing SOLine.LineNbr. 

@Irina documented this on “How to configure a business event to trigger for each line on the generic inquiry

Suppose that you need to set up a business event that will trigger for each detail line of the sales order. The same approach can be used for any other document in the system.

Step 1: When setting up the generic inquiry intended to use for business events, it is important to make sure that all the key fields are added to the Results Grid tab.

For example, for the PX.Objects.SO.SOLine table, it is important to make sure that LineNbr is included, otherwise, it will only trigger once for the whole order unless the order is saved after each line is entered.

 

Having this understanding moving forward is going to be really powerful for us. Thank you to both of you.  


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • August 24, 2021

This is awesome :) Thanks a lot for sharing the info here.

 


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 98 replies
  • December 14, 2021

@abrunner78 would you be able to screenshot the final import scenario you came up with? I’ve tried everything, but I still get the “unit conversion is missing” error message. 

I added the line number per Irina’s KB. I’ve even added the custom key as @Naveen B showed. Still getting this error!

I am updating service order appointment detail lines instead, but the concepts should be the same. I have this working in other screens… not sure how to get around this error. 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • December 15, 2021

Hi @sean21  Can you please share your import scenario.


abrunner78
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 40 replies
  • December 15, 2021

@sean21 I just want to preface my import scenario screen shot with my goal so you can see how it might aligns with yours.

I’m looking at a sales order (warranties: WW) to see if their is a receipt line. If there is, I look up the corresponding issue line add a note. I then take it one step further and only apply this to items being shipped from our main warehouse (TORMACH). 

Finally, some of the heavy lifting is being done by the GI. That is another topic we can get into if needed.   

Based on your error, I suspect you need to convert the line number to an integer with the CInt() function.It would look like this: CInt([SOLine_lineNbr]). 

A screen shot or XML of your import scenario will be helpful if ^^ doesn’t work.  

 


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 98 replies
  • December 15, 2021

@abrunner78 @Naveen B 

Here’s a screenshot of the import scenario. Also attached is the XML of the import scenario and the GI. 

I have the GI conditioned to bring in the lines I want to update only. As you can see in the import scenario, I’m just trying to update Project Task and Cost Code on the corresponding line in the appointment details.

I converted the LineNbr to integer, but still getting that error. I also messed with turning commit on/off for the Project Task and Cost Code, but got same result.

 


Neil Cantral
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • 62 replies
  • December 16, 2021

Line numbers in import scenarios start at zero. if you want to update the first line your target linenbr should be 0, fifth line would be linenbr 4, etc.

I don’t user your module, but I accomplish something similar on the Sales Order details section by using [SOLine.SortOrder]-1 in my source data to reliably target the correct line (not SOLine.Linenbr).


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 98 replies
  • December 16, 2021

@Neil Cantral Well would you look at that…. 

I started with the -1 but I was getting that error still so I abandoned it. After retesting and changing the key… it worked. Screenshot below for anybody else interested. 

 

 


Neil Cantral
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • 62 replies
  • December 16, 2021

You’ll probably want to disable the <Line Number> = -1  since that will target/create a new row.


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 98 replies
  • December 16, 2021

@Neil Cantral Good catch. That must have turned on by itself…. It still works properly with <Line Number> = -1 disabled. 


GCastellano29
Freshman I

I have tried all different permutations of import scenarios details and still I’m getting the “Unit Conversion is missing” error. Any help will be really appreciated. This is my import scenario based on examples above.

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 22, 2022

Hi @GCastellano29  Can you please try with @@LineNbr instead @@LineNumber and verify.

 


GCastellano29
Freshman I

Hi @Naveen Boga Thanks for the tip. it did actually work and now I do not get the error anymore. However, it is not updating the cost properly. It is assigning 0.00 to the Appointment Unit Cost. If I use an excel data provider it does work but if i use a business event it does not. This is the screenshot of the import scenario from the business event:

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 23, 2022

@GCastellano29  Can you please export your import scenario and share it here, so that I can check it from my end.

 

Can you please share the Business Event configuration as well.


GCastellano29
Freshman I

@Naveen Boga Sure. Import scenario, business event and generic inquiry attached.

 

To test it, you need to create an appointment and create a PO from a non-stock line. Then just create a Purchase Receipt from the PO. To trigger the business event again, just delete the Purchase Receipt and create it again.  


GCastellano29
Freshman I

@Naveen Boga By the way, I’m using 2021R2 211.0033.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings