Script to change orders PhoneNumber

Many of my German Ebay orders come into Linnworks with the value 'Invalid Request' in the Phonenumber Field.


This causes us problems when uploading to the carriers websites as the PhoneNumber field is no longer numeric.


I've started creating a script: 


namespace linnworks.finaware.CommonData.Objects // leave untouched

{ // leave untouched

    public class ScriptMacroClass : linnworks.scripting.core.IOrderScript // leave untouched

        { // leave untouched

            public void Initialize(linnworks.finaware.CommonData.Objects.Order order,linnworks.scripting.core.Debugger debug) // leave untouched

            { // leave untouched


             if(order.Source.ToUpper().Trim() == "EBAY" && order.Country.ToUpper().Trim() == "GERMANY"){

                 if(order.PhoneNumber.ToUpper.Trim() == "INVALID REQUEST"){

                    order.PhoneNumber = 0;

                    order.Save(0);

                  }

              }

            } // leave untouched

 

            public string Filter(){ // leave untouched

                /*Optional: Specify your order filter in query variable, must be SQL Statement that outputs pkOrderId column ONLY*/

                string query="";

                return query;

            }

 

    } // leave untouched

}     


I currently get an error saying: 'Linnworks.finaware.CommonData.Objects.Order' does not contain a definition for PhoneNumber


1 person has this question

A member of the support team informed me it is BuyerPhoneNumber not Phonenumber

Hi Paul,


I'm having a very similar problem.


When we want to print a UPS shipping label for an order we can't do so if the phone number field is blank. We need to manually change it to any dummy number, and then the shipping label will print.


Please can you help me with the script? 


What I want is a script that will replace a blank phone-number field with the dummy phone number that we choose. This should run on any order that's being assigned to UPS (via the rules engine, that I've already set up) and has a no phone number.


What's the code for a blank field (there's no error in the phone number field, it's just empty).


Thanks


Isaac


Login to post a comment