Order Management

Get Involved. Join the Conversation.


    Chandrajit Roy
    Primary Salesperson and Sales Credit
    Topic posted October 23, 2019 by Chandrajit RoyBlue Ribbon: 750+ Points, tagged Order Management 
    38 Views, 5 Comments
    Primary Salesperson and Sales Credit
    Primary Salesperson and Sales Credit - these two fields are available on sales order header. If user enters Primary Salesperson, how can we default the same sales person to Sales credit field.

    It is not automatically defaulting and if only Primary sales person is filled in (but not sales credit). then auto-invoicing fails .

    looks like both needs to  be filled in.  Is there a way we can default Sales credit from Primary Sales Person .







    • Riccardo Quaglia


      you can try pretransformation rules for sales orders, see note How to: Create Pre-Transformation Rule Using Virtual Information Builder (VIB) (Doc ID 2269861.1). Using VIB is easier to define rules. However, it seems that you can only define salesperson from order header to sales person field at line level. See attached example. I cannot see primary salesperson to be available in pretransfomation rules

      • Chandrajit Roy

        Hi Riccardo,

        thanks for responding.   Problem is if we create an order and do not populate values for both Primary Salesperson and Sales credit information, AR invoice fails saying sales person is missing. I tried entering only Primary sales person leaving sales credit blank (and vice versa- populate sales credit and leave salesperson blank), AR invoice import does not like it.

        We wanted to have user only enter Primary salesperson and system default the same value to Sales credit > Sales person .  what you said is defaulting from header to line.  But looking for primary salesperson to sales credit> Sales person (both in header).




    • Venkatesh Malapati

      You will need to write an Order Management Extension if the requirement is to create either header or line level salescredits automatically based of the primary salesperson entered on the header or the line. Rules doesn't support creating the salescredit automatically based of the primary salesperson.

      • Chandrajit Roy

        Thanks Venkatesh.


        So you are saying there is no out of box rule we can write to default this. Without this defaulting there is no other way to have AR invoice generated successfully. And user needs to enter same info twice.




    • Shyam Singh Patel

      Hi Chandrajit,

      This is possible only through OM Extension.

      Copy Salesperson into Sales Credit
      import oracle.apps.scm.doo.common.extensions.ValidationException;
      import oracle.apps.scm.doo.common.extensions.Message;
      import java.util.logging.Level;
      List<Message> messages = new ArrayList<Message>();
      def logger = context.getLogger();   
      //def custPONumber = header.getAttribute("CustomerPONumber")
      //if (!"SHYAMPATEL".equals(custPONumber))return;
        // getting order details
        def SourceTransactionIdentifier = header.getAttribute("SourceTransactionIdentifier");
        //def SourceTransactionLineIdentifier = line.getAttribute("SourceTransactionLineIdentifier");
        def SourceTransactionSystem = header.getAttribute("SourceTransactionSystem");
        def HeaderId = header.getAttribute("HeaderId");
        def PrimarySalesperson = header.getAttribute("Salesperson");
        //def SalespersonIdentifier = header.getAttribute("SalespersonIdentifier");
        def salesCredits = header.getAttribute("SalesCredits");
        while( salesCredits.hasNext() ) {
          def salesCredit = salesCredits. next();
          def Salesperson = salesCredit.getAttribute("Salesperson");
          def Percent = salesCredit.getAttribute("Percent");
          def SalesCreditTypeCode = salesCredit.getAttribute("SalesCreditTypeCode");
          //def SalesCreditIdentifier = salesCredit.getAttribute("SalesCreditIdentifier");
          def SourceTransactionSalesCreditIdentifier = salesCredit.getAttribute("SourceTransactionSalesCreditIdentifier");
      if( PrimarySalesperson != null )
      if( salesCredits.first() == null )
                      //if((salesCredits.first() == null ) || (Salesperson != PrimarySalesperson))
      def salesCredit = salesCredits.createRow();
      salesCredit.setAttribute("Salesperson", PrimarySalesperson);  
      salesCredit.setAttribute("Percent", "100"); 
      salesCredit.setAttribute("SalesCreditTypeCode", 1);
      salesCredit.setAttribute("SourceTransactionSalesCreditIdentifier", HeaderId);
                    //if(salesCredit.first()!= null && (Salesperson != null ) && (Salesperson != PrimarySalesperson))
      //salesCredit.first().setAttribute("Salesperson", PrimarySalesperson);  
      //salesCredit.first().setAttribute("Percent", "100");
                          //salesCredit..first().setAttribute("SalesCreditTypeCode", 1);