Skip to main content

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. 

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.

 

 


@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


@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’
 

 


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.

 


@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.  


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

 


@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. 


Hi @sean21  Can you please share your import scenario.


@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(sSOLine_lineNbr]). 

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

 


@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.

 


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 gSOLine.SortOrder]-1 in my source data to reliably target the correct line (not SOLine.Linenbr).


@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. 

 

 


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


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


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.

 


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

 


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:

 


@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.


@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.  


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


Reply