Prevent identical Sales Site and Sold-to BP Number

SOLVED

Good afternoon, we'd like to prevent our various sales sites from accidentally creating sales orders with identical Sales and Ship-to sites. Currently, there is a warning pop-up, but it does not fully stop the transaction, it just warns the user as soon as it detects identical values. It looks like this:

However, we would rather have this as pop-up that just prevents this action in the first place.

Any thoughts?

Thanks

Zoey

Top Replies

  • 0

    Hi Zoey,

    Hope you are doing great!

    Standard does not provide any option to stop the user at first place but you can make little change in code to achieve this.

    Incase you want any help in doing this kindly mail to [email protected].

  • 0 in reply to Greytrix

    Would you be able to reply with instructions in this post so that other people with the same question can see the answer?

  • 0

    Unfortunately I am still searching for a solution to this. Does anyone have any insight?

  • 0 in reply to Zoey Mattison

    Hi 
    Before suggesting anything, I want to clarify your request: you want to forbid the sales site entered in the header of the sales order is the same than the Ship site entered in the line.

    Is it right?

  • 0 in reply to Julien Patureau

    thanks for getting back to me! Let me clarify. I have updated the title to reflect this post a little better. Sorry for not being clear before --

    I am trying to prevent the fields SALFCY and BPCORD from being identical in the sales order header (SOH0), either by actively checking for this or by preventing the document from being created.

    Currently, in one of the standard scripts (maybe SUBSOHA) there is some code that returns this dialogue box if you enter identical values into those fields: (the message is 151,191,1)

    This is a good measure, but unfortunately it allows you to continue on with the creation of the document by clicking OK. Normally this wouldn't be a problem.. However, we have a process where we require our retail stores to send product back to the warehouse for various reasons. I will spare the details, but basically they will create a sales order using their site as the sales site (eg. 2600) and the sold-to customer number should be the warehouse (IDC30). However, even with this pop-up they manage to re-enter their own site into the sold-to customer number, as shown above. I am just looking to prevent this outright instead of just warning about it.

    I would prefer not to modify any SPE files if possible, and instead stop the creation of the document when the user clicks "create" with a custom script, like by setting an action to run under the predefined create button in the OSOH window as shown here. I'm not sure of the context for these buttons, but I read somewhere that they pass an "OK" value, and setting it to 0 will stop the creation. I do not know enough to try it out at this time though (don't want to mess anything up with a bad script):

    I will take anything you want to share regarding this. Thank you again for replying.

    Zoey

  • +1 in reply to Zoey Mattison
    verified answer

    This is an excellent example on how control tables can be useful! 

    Step 1 - Create a control table named TEST as follow:

    Step 2 - Assign this TEST control table to your field and screen (BPCORD in SOH0)

    Step 3 - Revalidate your entry transaction for good measure

    As a result, you can't enter a sold to BP matching the sales site code (control done when you exist the field Sold-to):

    Contol table is a great tool to increase the level of controls in your application without having to develop!

    Enjoy Slight smile

    Note: if you start to put control table everywhere this may impact the performance.

  • 0 in reply to Julien Patureau

    Note as the control is done when leaving the field Sold-to you can go back and update the sales site with the Sold-to BP code and doing so by pass the control. So for good measure I would advise you to setup another control table on the sale site to control that when you exist from SALFCY field that the value is <> BPCORD.

  • 0 in reply to Julien Patureau

    Omg... This is amazing. I have learned a lot of really cool things that Sage can do, but I think this is by far my favourite feature. Thank you very much for taking the time to write all of that out. It worked exactly as intended!! One more box ticked off the customization list..