Query that will trigger on Approval Procedures

Hi All,
I have this requirements that the user will prevent them to Add the Sales Order by triggering the Approval Procedures. I need the script that i can use to link on the Terms Based on the User Queries. The script will check if the Unit Price is deviates 50% from the original Unit Price.
Thanks and Regards,
Melvin

Hi Melvin,
User query approval will only work on document header. Line level checking is not possible unless you just care about the first line.
Thanks,
Gordon

Similar Messages

  • OTL I am trying to wright a SQL query that will return the date the timesheet was submitted and date/time it was approved, can anyone guide me on this?

    Hi
    I am trying to wright a SQL query that will return the date the timesheet was submitted and date/time it was approved, can anyone guide me on this?
    I basically need person name who submitted, date - time it was submitted for approval, then the person who approved it and the date - time that it was approved
    Thanks
    Ruby

    Ruby,
    you can start with HXC_TIMECARD_SUMMARY table for submitter detail. But for approver details, i think you need WF tables to get the data for item type HXCEMP.

  • Need help writing a MySQL query that will return only records with matching counter-parts

    Since I don't know how to explain this easily, I'm using the
    table below as an example.
    I want to create a MySQL query that will return only records
    that have matching counter-parts where 'col1' = 'ABC'.
    Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC' record. This record should not be
    returned because there is no matching counter-part. With this
    table, the 'ABC / GHI' record should be the only one returned in
    the query.
    How can I create a query that will do this?
    id | col1 | col2
    1 | ABC | DEF
    2 | DEF | ABC
    3 | ABC | GHI
    4 | DEF | GHI
    5 | GHI | DEF
    *Please let me know if you have no idea what I'm trying to
    explain.

    AngryCloud wrote:
    > Since I don't know how to explain this easily, I'm using
    the table below as an
    > example.
    >
    > I want to create a MySQL query that will return only
    records that have
    > matching counter-parts where 'col1' = 'ABC'.
    >
    > Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC'
    > record. This record should not be returned because there
    is no matching
    > counter-part. With this table, the 'ABC / GHI' record
    should be the only one
    > returned in the query.
    >
    > How can I create a query that will do this?
    >
    >
    > id | col1 | col2
    > --------------------
    > 1 | ABC | DEF
    > 2 | DEF | ABC
    > 3 | ABC | GHI
    > 4 | DEF | GHI
    > 5 | GHI | DEF
    >
    >
    > *Please let me know if you have no idea what I'm trying
    to explain.
    >
    Please be more clear. You say that 'ABC / GHI' should not be
    returned,
    and then you say that 'ABC / GHI' should be the only one
    returned. Can't
    have both...

  • Generic report query that will work against common table ..

    Context
    We have a custom audit log scheme that inserts all table changes into a backing table via triggers. For example, an insert into table ORDER would cause a insert into ORDER_AUD.
    Problem
    We want to build a generic report query that will work against any audit table.
    While constructing a report query for a class that uses inheritance, we see TopLink? add an extra where-clause.
    We are required to set the ReferenceClass? for the query, however, the tables we are querying are not mapped to TopLink?. We just want to map the query results to objects of the Reference Class.
    The extra where-clause specifies the table of the Reference Class, but since that table is not in the From clause, the query doesn't work.
    The ReportQuery? in Question
    public DatabaseQuery loadAuditHistory(Class cls, String audTableName ) {
    String emanAuditTableName = "eman_audit";
    ExpressionBuilder expressionBuilder = new ExpressionBuilder();
    Expression exp = expressionBuilder.getTable(audTableName)
    .getField("instance_id")
    .equal(expressionBuilder.getParameter("instanceId"))
    .and(expressionBuilder.getTable(audTableName).getField("audit_id")
    .equal(expressionBuilder.getTable(emanAuditTableName).getField("audit_id")));
    ReportQuery query = new ReportQuery(expressionBuilder);
    query.setReferenceClass(cls);
    query.setSelectionCriteria(exp);
    query.addArgument("instanceId");
    query.addAttribute("Changed By", expressionBuilder.getTable(emanAuditTableName).getField("audit_user"));
    query.addAttribute("Host", expressionBuilder.getTable(emanAuditTableName).getField("audit_host"));
    query.addAttribute("UTC Timestamp", expressionBuilder.getTable(emanAuditTableName).getField("audit_utc_timestamp"));
    query.addAttribute("Action", expressionBuilder.getTable(audTableName).getField("table_action_code"));
    Descriptor orderDescriptor = session.getDescriptor(cls);
    Vector mappings = orderDescriptor.getMappings();
    for (Iterator iter = mappings.iterator(); iter.hasNext();) {
    Object element = (Object) iter.next();
    if (element instanceof DirectToFieldMapping) {
    DirectToFieldMapping mapping = (DirectToFieldMapping)element;
    DatabaseField field = mapping.getField();
    String tableName = field.getTableName();
    String fieldName = field.getName();
    query.addAttribute(fieldName, expressionBuilder.getTable(audTableName).getField(fieldName));
    Expression version = expressionBuilder.getTable(audTableName).getField("version_id");
    query.addOrdering(version.descending());
    query.setName(GET_AUDIT_HISTORY);
    return query;
    Code Generated by the ReportQuery?
    SELECT t0.audit_user, t0.audit_host, t0.audit_utc_timestamp,
    t1.table_action_code, t1.INSTANCE_ID, t1.STATUS,
    t1.REQUESTER, t1.DESCRIPTION, t1.RECIPIENT
    FROM eman_audit t0, example_order_aud t1
    WHERE (((t1.instance_id = 60432)
    AND (t1.audit_id = t0.audit_id))
    AND (EXAMPLE_ORDER.CLASS_NAME = 'eman.infra.toplink.example.project.model.Order'))
    ORDER BY t1.version_id DESC
    Descriptor used to Map Oder.class
    public Descriptor buildOrderItemDescriptor() {
    Descriptor descriptor = new Descriptor();
    descriptor.setJavaClass(eman.infra.toplink.example.project.model.OrderItem.class);
    descriptor.addTableName("ORDERITEM");
    descriptor.addPrimaryKeyFieldName("ORDERITEM.INSTANCE_ID");
    // Inheritance properties.
    descriptor.getInheritancePolicy().setClassIndicatorFieldName("ORDERITEM.CLASS_NAME");
    descriptor.getInheritancePolicy().useClassNameAsIndicator();
    // Descriptor properties.
    descriptor.useSoftCacheWeakIdentityMap();
    descriptor.setIdentityMapSize(100);
    descriptor.useRemoteSoftCacheWeakIdentityMap();
    descriptor.setRemoteIdentityMapSize(100);
    descriptor.setSequenceNumberFieldName("ORDERITEM.INSTANCE_ID");
    descriptor.setSequenceNumberName("CIM_ID");
    VersionLockingPolicy lockingPolicy = new VersionLockingPolicy();
    lockingPolicy.setWriteLockFieldName("ORDERITEM.VERSION_ID");
    descriptor.setOptimisticLockingPolicy(lockingPolicy);
    descriptor.setAlias("OrderItem");
    // Query manager.
    descriptor.getQueryManager().checkCacheForDoesExist();
    //Named Queries
    // Event manager.
    // Mappings.
    DirectToFieldMapping instanceIdMapping = new DirectToFieldMapping();
    instanceIdMapping.setAttributeName("instanceId");
    instanceIdMapping.setFieldName("ORDERITEM.INSTANCE_ID");
    descriptor.addMapping(instanceIdMapping);
    DirectToFieldMapping ItemNumberMapping = new DirectToFieldMapping();
    ItemNumberMapping.setAttributeName("ItemNumber");
    ItemNumberMapping.setFieldName("ORDERITEM.ITEM_NUMBER");
    descriptor.addMapping(ItemNumberMapping);
    DirectToFieldMapping QuantityMapping = new DirectToFieldMapping();
    QuantityMapping.setAttributeName("Quantity");
    QuantityMapping.setFieldName("ORDERITEM.QUANTITY");
    descriptor.addMapping(QuantityMapping);
    OneToOneMapping orderMapping = new OneToOneMapping();
    orderMapping.setAttributeName("order");
    orderMapping.setReferenceClass(eman.infra.toplink.example.project.model.Order.class);
    orderMapping.setRelationshipPartnerAttributeName("orderItems");
    orderMapping.dontUseIndirection();
    orderMapping.addForeignKeyFieldName("ORDERITEM.ORDER_ID", "EXAMPLE_ORDER.INSTANCE_ID");
    descriptor.addMapping(orderMapping);
    return descriptor;

    I'm am very confused as to what you are trying to do, are you trying to query Order objects from the ORDER_AUD historical table instead of the table that the class is mapped to?
    TopLink 10.1.3 (DP3) has built in support for historization, you may wish to investigate this support to allow historical querying of your audit tables.
    In general you cannot use a ReportQuery to do this, a ReportQuery is for querying data from objects based on an object-level criteria. I think that you want to query objects, but just using different SQL than the descriptors are mapped to.
    You could do this through a custom SQL read query,
    i.e.
    ReadAllQuery query = new ReadAllQuery(Order.class);
    query.setSQLString("Select * from ORDER_AUD where INSTANCE_ID = #id");
    query.addArgument("id");
    Vector argumentValues = new Vector(1);
    argumentValues.add(id);
    List objects = (List) session.executeQuery(query, argumentValues);
    As long as the field names in the audit and the original table matched this would work. However if this is a historical table, then I would guess that there might be multiple objects with the same id, so querying these historical objects could confuse the TopLink cache. You could set dontMaintainCache() on the query to avoid this.
    In general you would probably be much better off having two sessions, one with the descriptors mapped to the normal tables, and one with the descriptors mapped to the audit tables. Then you would be able to query both using regular object-level queries.

  • Query that will run on the items matrix and trigger Approval procedure

    Hello,
    We are trying to design an approval procedure whenever an item code appears in a certain UDT.
    For example, we have many items in OITM.
    We have 50 of those items also in @BIN.
    The approval procedure should be triggered only when the document lists one of the items that appear in @BIN.
    I am using the following query:
    SELECT 'TRUE'   where $ [$38.1.0]  IN (Select code from [@BIN] )
    The problem is that the query would only search on the first row and wouldnu2019t continue to the next rows.
    Do you have any idea how to bypass this limitation?
    Thanks in advance
    Revital
    SELECT 'TRUE'   where $[$38.1.0]  IN (Select code from [@BIN] )

    Hi Revital,
    One way to implement this functionality would be to use a UI API that verifies the values while filling the items in the Matrix. For this you would need a little programming knowledge but no extra license.
    There is a lot of information including Code Samples in the SDK Package delievered with every patch of Business One.
    Kind Regards,
    Friederike Mundt

  • Query base multiple levels  PO approval procedure

    Hi,
    My customer is having following requirement for PO approval procedure and would like to seek for solution.
    The suppliers are either CAPEX or OTHERS supplier which I think of using UDF U_CAPEXSUPPLIER=Y or N in BP master setup.
    OTHERS supplier PO
    <RM2000 approved by local accounts
    >RM2000 approved by CFO or one of directors
    CAPEX supplier PO
    <RM5000 approved by CFO
    >RM5000 approved by one of Board of Directors
    The 2000 and 5000 figures are applicable to both local and foreign purchase. ie if it USD suppliers then limit is USD2000
    Thanks and regards
    Thomas

    Thomas,
    Open Query Generator....Click Execute.....With the Red message at the bottom..you will see the SELECT *
    click on the Pencil icon and copy over each of my queries and save it using a different name.
    Then Add an Approval Stage for each Approver..
    Using the Approval Template..Give a Name...Make Sure Active check box is CHECKED next to the Name
    Select the Originators (users whose document should go through the approval process)..In the document tab select the documents for which this approval applies..Stages Tab..select the associated Approval Stage defined earlier..
    Term tab: Select When the following Applies
    In the lower window...double click onn the first row under Query Name..Select your query and ADD. 
    Make Sure Active check box is CHECKED next to the Name
    Suda

  • User query that will populate item description from items checked in prop.

    Hi everyone I have a question about a user query that needs to be created.
    In the item master data form under the properties tab I need what ever is checked in that table to be populated in the Description field. I dont know if this is possible or not but can please someone help me with this. Thanks

    I am not sure if it can be done while in Add Mode as the values of Properties checked might not be available till the Item is added to the database.
    Through Stored procedure you can do this once you add the Item Code.
    The Code for the same is as below.  You need to Pass 3 parameters
    The SQL to call the SP from the Item Description field would be
    EXEC     [dbo\].[ITEMDESC\] $\[$5.0.0], $\[$39.0.0], $\[$114.0.0]
    CREATE PROCEDURE [dbo\].[ITEMDESC\](@ITEM NVARCHAR(20), @ITMSGRPCODE NVARCHAR(3), @FIRMCODE NVARCHAR(3))
    AS
    BEGIN
         DECLARE @GrpName AS NVARCHAR(20), @FirmName AS NVARCHAR(30)
         DECLARE @SQLString nvarchar(500), @I AS INT, @N AS NVARCHAR(2), @OUTPUT AS NVARCHAR(100), @PNAME AS NVARCHAR(100)
         DECLARE @ParmDefinition nvarchar(500)
         SET @ParmDefinition = '@ITEM NVARCHAR(20), @OUTPUT NVARCHAR(100) OUTPUT'
         SET @PNAME = ''
         SET @I = 1
         WHILE @I <= 64
         BEGIN
              SET @N = CAST(@I AS VARCHAR(2))
              SET @SQLString = 'SELECT @OUTPUT = CASE WHEN T0.QryGroup' + @N + '= ''Y'' THEN T1.ItmsGrpNam ELSE '''' END FROM [dbo\].[OITM\] T0, [dbo\].[OITG\] T1
                             WHERE T0.ITEMCODE = @ITEM AND T0.QryGroup'+@N + '= ''Y'' AND ItmsTypCod = '+@N
              EXECUTE sp_executesql @SQLString, @ParmDefinition,@ITEM, @OUTPUT OUTPUT
              SET @I = @I + 1
              IF @OUTPUT <> ''
              BEGIN
                   SET @PNAME = @PNAME + (@OUTPUT + ', ')
                   SET @OUTPUT = ''
              END
         END
         SELECT @GrpName = ItmsGrpNam FROM OITB WHERE ItmsGrpCod = @ITMSGRPCODE
        SELECT @FirmName = FirmName FROM OMRC WHERE FirmCode = @FIRMCODE
         SELECT @GrpName + ', ' + @PNAME + @FirmName
    END

  • Run a query that will determine the number of parts to produce

    I have the task that I have to determine the number of parts that need to be produced based on the number of products sold for the day (each product consists of many parts).
    I am using SQL 11g Express.
    I have stared at this for so long and tried so many different ways. Below are a few of what I have tried, with the error messages. I'm not sure where I'm going wrong to get this calculation. Any help here is greatly appreciated!
    Here's my info:
    /**PRODUCT**/
    CREATE table Product
        SKU       VARCHAR2(10) NOT NULL,
        ProdDesc   VARCHAR2(50) NOT NULL,
        Price      NUMBER(5,2),
        PRIMARY KEY(SKU)
    /**PART**/
    CREATE table Part
        PartID     NUMBER(6) NOT NULL,
        PartDesc   VARCHAR2(50) NOT NULL,
        PRIMARY KEY(PartID)
    /**PRODUCTPART**/
    CREATE table ProductPart
        SKU        VARCHAR2(10) NOT NULL CONSTRAINT fk_ProductPart_Product REFERENCES Product (SKU),
        PartID     NUMBER(6) NOT NULL CONSTRAINT fk_ProductPart_Part REFERENCES Part (PartID),
        NumOfParts NUMBER(3),
        CONSTRAINT pk_ProductPart PRIMARY KEY (SKU, PartID)
    CREATE table Customer
        CustID     NUMBER(6) NOT NULL,
        CustFname  VARCHAR2(20) NOT NULL,
        CustLname  VARCHAR2(20) NOT NULL,
        Company    VARCHAR2(40),
        Address    VARCHAR2(40) NOT NULL,
        City       VARCHAR2(30)NOT NULL,
        State      VARCHAR2(2)NOT NULL,
        Zip        NUMBER(5)NOT NULL,
        Phone      NUMBER(10)NOT NULL,
        PRIMARY KEY (CustID)
    CREATE table CustOrder
        OrderID    NUMBER(6) NOT NULL,
        Qty        NUMBER(3) NOT NULL,
        OrderDate  Date NOT NULL,
        SKU        VARCHAR(10) NOT NULL CONSTRAINT fk_CustOrder_Product REFERENCES Product (SKU),
        CustID     Number(6) NOT NULL CONSTRAINT fk_CustOrder_Customer REFERENCES Customer (CustID),
        PRIMARY KEY (OrderID)
    Here are some of the queries:
    SELECT ProductPart.Qty
    SELECT CustOrder.SKU,
    sum(CustOrder.qty)
    FROM CustOrder
        GROUP BY CustOrder.SKU;)
    FROM ProductPart
    WHERE ProductPart.Qty * sum(CustOrder.Qty)
    ORA-00936: missing expression
    SELECT o.OrderDate AS "Date Ordered",
           o.OrderDate + 5 AS "Date Due",
           pp.PartID AS "Part No.",
        pp.NumOfParts * COUNT(o.SKU) AS "Qty"
    FROM CustOrder o
    JOIN ProductPart pp
      ON o.SKU = pp.SKU
        GROUP BY pp.PartID, o.OrderDate, COUNT(o.SKU)
    ORDER BY o.OrderDate
    ORA-00934: group function is not allowed here
    SELECT ProductPart.Qty,
           ProductPart.PartID,
           ProductPart.PartDesc
    (SELECT COUNT(CustOrder.SKU)
    FROM CustOrder
    GROUP BY CustomerOrder.SKU)TotalProducts,
    ProductPart.Qty * TotalProducts AS "Qty"
    FROM ProductParty
    WHERE CustOrder.SKU = Product.SKU
    AND Product.SKU = ProductPart.SKU
    ORA-00936: missing expression
    SELECT ProductPart.Qty,
           ProductPart.PartID,
           ProductPart.PartDesc
    (SELECT sum(CustOrder.qty)
    FROM CustOrder
    GROUP BY CustOrder.SKU)TotalProducts
        ProductPart.Qty * TotalProducts
        FROM ProductPart
    ORA-00936: missing expression

    Hi,
    893443 wrote:
    ... CREATE table CustOrder
    OrderID NUMBER(6) NOT NULL,
    Qty NUMBER(3) NOT NULL,
    OrderDate Date NOT NULL,
    SKU VARCHAR(10) NOT NULL CONSTRAINT fk_CustOrder_Product REFERENCES Product (SKU),
    CustID Number(6) NOT NULL CONSTRAINT fk_CustOrder_Customer REFERENCES Customer (CustID),
    PRIMARY KEY (OrderID)
    INSERT INTO CustOrder(OrderID, Qty, OrderDate, SKU, CustID)
    VALUES(2101, 2, '10-26-2011', 'DVCK1212', 1101);You're still trying to put a VARCHAR2 into a DATE column. Depending on your NLS settings, that may work on your system (at least today), but it definiely doesn't work on mine.
    Don't use a VARCHAR2 where a DATE is expected. Use TO_DATE to convert a string into a DATE:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/functions203.htm#sthref1662
    Ideally The report would look something like this:Why not like this?
    ORDERDATE      PARTID PARTDESC                        TOTAL_QTY
    10-24-2011       1003 12" X 24" Ventilated Shelf             42
    10-24-2011       2001 12" X 12" Solid Shelf                 108
    10-24-2011       3001 12" X 96" Side Panel                   50
    10-25-2011       1004 12" X 30" Ventilated Shelf             72
    10-25-2011       2001 12" X 12" Solid Shelf                  54
    10-25-2011       2002 12" X 18" Solid Shelf                   6
    10-25-2011       3001 12" X 96" Side Panel                   44
    10-26-2011       1001 12" X 12" Ventilated Shelf             42
    10-26-2011       1004 12" X 30" Ventilated Shelf              6
    10-26-2011       2003 12" X 24" Solid Shelf                  12
    10-26-2011       3001 12" X 96" Side Panel                   20Did you make some mistakes in your results? If not, explain how to get the correct results in the places where the ouput above is wrong. For example, how do you get the row for orderdate of Oct 26 and partid=2001?
    {OrderDate    PartID    PartDesc NumOfParts(Total for that day)
    10-24-2011    2001    12" X 12" Solid Shelf 108
    10-24-2011    2003    12" X 24" Solid Shelf 32
    10-24-2011    3001    96" Side Panel 50
    10-25-2011    2002    12" X 18" Solid Shelf 6
    10-25-2011    2001    12" X 12" Solid Shelf 54
    10-25-2011    1004    12" X 30" Ventilated Shelf 72
    10-25-2011    3001    96" Side Panel 44
    10-26-2011    2001    12" X 12" Solid Shelf 12
    10-26-2011    2004    12" X 30" Solid Shelf 6
    10-26-2011    2003    12" X 24" Solid Shelf 12
    10-26-2011    1001    12" X 12" Ventilated Shelf 30
    10-26-2011    3011    96" Side Panel 20}Use \ tags, as described in my last message, before and after formatted text, to preserve spacing.
    My issue is, I can't get the equation right to produce the total number of parts. I think I need to multiply ProductPart.NumOfParts by SUM(CustOrder.Qty) Group by CustOrder.SKU.More likely that you need to multiply numofparts * qty, and then take the SUM of the result.
    Why would you GROUP BY sku?  Does each row of output represent a different product (and therefore a different sku), or does each row of output represent a different part. regardless of which product(s) that part is related to?
    If you want a separate total for each orderdate, you'll have to include orderdate in the GROUP BY clause, too.
    To get partdesc in the output, you'll either need to include partdesc in the GROUP BY clause, or wrap it in an aggregate fucntion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help bout a query that will print data in matrix format..

    solved
    null

    SQL> create table mytable
      2  as
      3  select 'pranita' consultant_name, 'manager' designation, 'sohan' salesman from dual union all
      4  select 'pradeep', 'ceo', 'nick' from dual union all
      5  select 'sham', 'developer', 'prasad' from dual union all
      6  select 'john', 'designer', 'sohan' from dual union all
      7  select 'sam', 'developer', 'rajesh' from dual union all
      8  select 'pranita', 'manager', 'sohan' from dual union all
      9  select 'john', 'designer', 'anand' from dual union all
    10  select 'pradeep', 'ceo', 'rohit' from dual union all
    11  select 'sam', 'developer', 'nick' from dual
    12  /
    Tabel is aangemaakt.
    SQL> select consultant_name
      2       , designation
      3       , count(decode(salesman,'sohan',1)) "sohan"
      4       , count(decode(salesman,'nick',1)) "nick"
      5       , count(decode(salesman,'prasad',1)) "prasad"
      6       , count(decode(salesman,'rajesh',1)) "rajesh"
      7       , count(decode(salesman,'anand',1)) "anand"
      8       , count(decode(salesman,'rohit',1)) "rohit"
      9    from mytable
    10   group by consultant_name
    11       , designation
    12  /
    CONSULT DESIGNATI      sohan       nick     prasad     rajesh      anand      rohit
    sam     developer          0          1          0          1          0          0
    john    designer           1          0          0          0          1          0
    pradeep ceo                0          1          0          0          0          1
    sham    developer          0          0          1          0          0          0
    pranita manager            2          0          0          0          0          0
    5 rijen zijn geselecteerd.Regards,
    Rob.

  • Approval procedure on item groups

    Hi All
    I would like your assistance on this query, I need a query that will execute an approval procedure when an item with item group name contains or part of the word software is used on the sales quote . 
    I need to know how can i pull the item group from a selected item and display that on a udf and use info on that udf to trigger an approval .
    Thanks
    Bongani
    Edited by: Bongani Dlamini on Jul 13, 2009 1:25 PM

    hai Bongani Dlamini
       Row level approval is not possible in SAP B1,as a work around try this query in approval template,this will help u to check
    only first item,other wise u have to write stored procedure
    SELECT DISTINCT 'True' FROM QUT1 T0 WHERE $[$38.1.1]  =
    (select distinct  itemcode from oitm o1,oitb o2  where
    o1.itmsgrpcod = o2.itmsgrpcod and o1.itemcode = (select $[$38.1.1] ) and o2.ItmsGrpNam like '%Software%'  )

  • Customize Approval Procedure for Past Due Invoice don't work !

    Hi all,
    Below is the query written to trigger the approval procedure if past due invoice happen
    Select 'true'
    from OINV
    where DocDuedate < Getdate() and DocStatus='O' and DocTotal >
    PaidTODate
    However, it will not trigger, can someone please help on this?
    Thanks

    Hi,
    Try this:
    SELECT distinct 'true' FROM OINV T0 INNER JOIN OCRD T1 ON
    T0.CardCode = T1.CardCode WHERE T0.CardCode = $[$4.0.0] AND
    DateDiff(dd,T0.[DocDueDate],Getdate())>30 and T0.DocStatus='O'
    Thanks & Regards,
    Nagarajan

  • Query Based Approval Procedure for Sales order .

    Hi 
    I have created query for SO which results above 5000 d 50,000 .
    By using this each query i created two seperate Approval Procedures which So is >5000 d >50000.
    If So>5000 Approval Procedure wants to activate same thing for >50,000., Bur approval Procedure is not working wat will be the cause. i have linked this query In Terms as when the following applies.
    If SO >5000 approved by user A.
    If SO>50,000approved by User A & B.
    Regards
    Giridharan

    Hi Giri
    Your query for the first should be as follows:
    SELECT DISTINCT TRUE
    WHERE $[$29.0.NUMBER] > 5000 AND $[$29.0.NUMBER] < 50000
    For the second query:
    SELECT DISTINCT TRUE
    WHERE $[$29.0.NUMBER] > 50000
    The query you were trying to use is looking at the table which will only apply to documents already posted, and as that query is not being filtered specifically it is bringing back all the records and getting confused. You must reference to the runtime value of the document being posted.
    Kind regards
    Peter Juby

  • Approval Procedure based on query

    Dear All,
    I'd like to make approval procedure based on query.  The condition is when the AP Invoice document created based on GRPO and there's a different Amount (AP Amount <> GR Amount) then it should trigger the approval procedure.
    Do you have any idea about the query structure?
    Thanks

    shobah,
    try this below query like this
    Select TRUE From OPCH Where DocTotal > 25000
    Jeyakanthan

  • Does editing document trigger Approval Procedures checking?

    Can anyone confirm that a document go through Approval Procedures checking when it is being added? It does not trigger the checking when it is edited?
    I notice if I add a document, the Approval Procedures kicks in, but if I edit a document (so that it meet the Approval Procedure criteria) the Approval Procedure does not appear.
    Thanks.

    Thanks Rahul, if the document initially does not trigger approval procedure but after changes it should trigger approval procedure, for example:
    Credit Limit $1,000, Outstanding Balance $800, user created a Sales Order of $150, added to the system and edit it to $250 after that. The editing should trigger approval procedure but it doesn't.
    Is it correct system behaviour?

  • Approval procedure based on item category

    Dear All,
    I have a scenario where all my sales items will be categorized under two broad heads: Bulk & Non Bulk. So there will be a UDF where every item will be mapped to one of these values. I want to apply an approval procedure where I am able to raise an approval to different set of people for Bulk Items and different set of people in case of Non Bulk items. Kindly help me how I can do the same.
    Regards
    Kapil Kapoor

    Hi,
    It's not possible to create approval procedure based on item level. So if in a single document you have different types of (bulk/non-bulk) items you can't trigger different approval procedures.
    In case you select the item type in a UDF in header level of a document, then it will be possible to send approval to different users based on the UDF value selected bulk/non-bulk.
    Regards
    Sibasish S.

Maybe you are looking for

  • How to change network settings

    hello, so i just recently got my first macbook pro (yay me) and the day i was setting it up i was going through the start ups and all and when it came to the network connections i used a connection that is a guest connection for my home router and no

  • Upgraded to 10.6.7 and now can't connect to wireless.

    Hi, I'm not the most experienced when it comes to this type of thing so I will try and be as detail as I can so that someone may be able to provide me with a solution. I have a 13"  MacBook (about 4 years old) and recently increased my RAM from 512mb

  • Hierarcical cost planning in project system

    Hi, Can anyone tell me, as I am not getting the planned cost in any report for any WBS element for which I have entered the manual planned cost using CJ40. what are the settings that has to be made in IMG for getting that, as i have the maintained th

  • CS4 : is there a way to show the windows taskbar in fullscreen mode?

    Does anyone know of a way to be in "FULL SCREEN MODE WITH MENU BAR", but to still have the windows taskbar being displayed? In CS2 XP, the taskbar was always displayed in that mode, but in CS4 64 VISTA, it unfortunately doesn't draw the taskbar in th

  • What is the issue of using Adobe Reader 11 and Mac OS10.7 to print?

    I have followed all the indicated trouble shooting steps and nothing works.    Is there an incompatibility ?@