Adding a query to the approval template

Hello
I'm trying to setup an approval template for AR Invoices based on a UDF.
Basically I want to add a query to the approval template that will trigger an approval request based on the following query
but i don't know how to set it properly.
trigger an approval when:
select * from OINV where u_ordertype = 'sub'
any help would be appreciated it!
Mike

Hi Mike,
Try this:
select 'true' from OINV T0 where T0.u_ordertype = 'sub' and T0.DocNum = $[$8.0.0\]
Thanks,
Gordon

Similar Messages

  • While executing the query in the web template I am  facing below issue

    Hello SAP geniuses,
    Please help me on my issue  ,
    while executing the query in the web template i am  facing below issue.
    The variable for characteristic (region) is appearing but this characteristic (region) is not appearing in the free characteristic zone  but when we are executing the query with out webtemplate it is showing both variable and free characteristic
    can anybody help us to identify what is the issue with the web template.
    Thanks
    Alok

    Hi,
    Plz check ur report and execute at the designer and take its technical name and go to RSRT. log out and log in and try..
    if not check ur authorisation.
    Regards....KP

  • Query support for approval templates

    hi
    i want set approval on the base of query so i write query as follow 
    SELECT T0.[CardName], T0.[CreditLine] FROM OCRD T0  INNER JOIN OCRG T1 ON T0.GroupCode = T1.GroupCode INNER JOIN OINV T2 ON T0.CardCode = T2.CardCode
    WHERE T1.[GroupName] ='INSTATION' AND
    T0.[CreditLine] >= 0 AND
    T0.[CreditLine] <=50000
    GROUP BY T0.[CardName],T0.[CreditLine]
    but on this condition approval is not set so if i write query wrong then pls send updated quer
    regards,
    sandip

    Hi
    There are plenty of threads how to write user defined query for  writing approval query .
    You have to use something like this ;
    Select Distinct true ...
    Here is what I found for you
    Re: HELP TO WRITE A QUERY
    Please search forum first
    Thank you
    Bishal
    Edited by: BIshal Adhikari on Dec 11, 2008 9:59 AM

  • Adding New Originator in Approval Template

    Hi,
    1. I initially created 5 users where when they create Sales Orders, they will have to go through the approval stage. The condition which was set is based on query. When I add additional users in the approval template to go thru this process, there's a message says 'No ratio has been defined'.
    What could caused this?
    2. After i add new users, do i have to reselect the query in able for them to go thru this approval process?
    Appreciate your help.
    Rgds,
    Harith

    Hi,
    When you Select the "When the Following  Applies" options you can view two windows below that option.
    In first Window, You can view the "Choose", "Term", "Ratio", "Value" Columns. In "Choose" Column you will find Check Box. In "Terms" Column you find Condition terms (ie,. like Deviates from budget, Discount% etc). In "Ratio" column  you find conditions like Greater Tha, Less than etc., In "Value" column you should give the  value based on which the condition works.
    When you Select the Checkbox then the corresponding Condition will be taken for Approval Procedure.
    In Second Window, "Terms Based on User Queries" You will select the query you have generated for approval process.
    If you are using Second Window you do not select any options in First window. You can view one of the option was selected after you have linked the query in second window.
    Raja.S

  • Approval Template based on Query

    Hi All,
    I want to wirte a query for defining approval templates.If any document (both on sales and Purchase side) is raised by a non-superuser,it should be sent for approval ,to the superusers ,before it is posted.
    we have set approval templates for this.
    But now,if the document contains the items with group code '101' ,then it should be sent for approvel to the superuser 'A' alone.(it is sure that in a single document items with different group codes will not be present).Others should be sent for approvel to superuser 'B'.
    I know that this can be done only by using "Terms based on Queries" in approval templates.
    I have never used this before.Can anyone help me with the query for this template?
    Thanks& Regards,
    V.M.Nivasini

    Hi
    The query is like this
    SELECT T2.[ItmsGrpCod],T1.[ItemCode] , T1.[Dscription] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] = 101
    Create different queries for different Groups in where clause, Assign the query to respective Approver.
    Hope this helps.
    Regards
    Reno

  • Approval Templates for the User Defined Object(UDO)

    Hi,
    I just wanted to check whether the Approval Templates for the User Defined Object(UDO)...i.e. Said to the User Defined Form..
    if possibe how it can be done.....
    Thanks in Advance,
    With Regards,
    MadhuSudhana Rao.G

    Hi MadhuSudhana Rao,
    The function you requested is not available yet.
    Thanks,
    Gordon

  • To Activate the Approval Process when document is in update mode

    Dear Expert,
                        I have applied the Approval Process for UDF using the query "Select Distinct 'True' From ORDR T0
    Where IsNull($[ORDR.U_Rebate.number],0)>0 and $[ORDR.DocType]='I' ".
    Now as the field is UDF user is able to modify even after approval procedure.
    Please help me to apply the above query for the  Approval process even when the document is in update mode.
    regards,
    PankajK

    Dear Pankaj,
    Current B1 design only support approval for adding document. Update will not trigger approval.
    You may use SP_TN instead to block user updating it. If you are not familiar with the SP, search the forum first.
    Thanks,
    Gordon

  • Approval Template Not Working

    Hi Experts.
    I have activated approvals and have a simple approval template working (as a test) whereby AR Invoices exceeding a certain value require approval.
    I have also created an approval template whereby Purchase Orders require approval if they are over the users approval limit but under their manager's approval limit as defined in UDFs against the employee record.  This approval is not working.
    The approval is based on a query:
    select distinct 'true'
    from opor a, por1 b, oact c, ohem d, ohem e
    where a.docentry = b.docentry
    and a.canceled = 'n'
    and a.docstatus = 'o'
    and a.docentry = b.docentry
    and b.acctcode = c.acctcode
    and a.docnum = $[OPOR.DocNum]
    and a.ownercode = d.empid
    and d.manager = e.empid
    and (
         (b.u_budgeted = 'budget'and c.groupmask = 6
              and (a.doctotal-a.vatsum > d.u_budgetexpense or d.u_budgetexpense is null))
    or  (b.u_budgeted = 'budget'and c.groupmask = 1
              and (a.doctotal-a.vatsum > d.u_budgetcapital or d.u_budgetcapital is null))
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 6
              and (a.doctotal-a.vatsum > d.u_nonbudgetexpense or d.u_nonbudgetexpense is null))
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 1
              and (a.doctotal-a.vatsum > d.u_nonbudgetcapital or d.u_nonbudgetcapital is null)) )
    and (
         (b.u_budgeted = 'budget' and c.groupmask = 6
              and a.doctotal-a.vatsum <= e.u_budgetexpense
              and e.u_budgetexpense is not null)
    or  (b.u_budgeted = 'budget' and c.groupmask = 1
              and a.doctotal-a.vatsum <= e.u_budgetcapital
              and e.u_budgetcapital is not null)
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 6
              and a.doctotal-a.vatsum <= e.u_nonbudgetexpense
              and e.u_nonbudgetexpense is not null)
    or  (b.u_budgeted = 'non-budget' and c.groupmask = 1
              and a.doctotal-a.vatsum <= e.u_nonbudgetcapital
              and e.u_nonbudgetcapital is not null) )
    The query will return the value 'true' if executed when the PO document is displayed on the screen, so I am happy with the query.
    I think maybe the problem might be on the Terms tab of the Approval Template because Total Selected Terms = 2.  I think this should be 1.
    There is a tick against Undefined Type under Term and I can remove this so that Total Selected Terms = 1, then I click on Update and OK - but when I go back in again the tick is back and Total Selected Terms = 2 again.
    Any suggestions would be very much appreciated.
    Regards.  Julie

    Hi.
    Thank you for your replies.
    The solution I worked out was to select the Term 'Total Document' as 'Greater than $1.00'.
    This enabled me to successfully de-select the last Term 'Undefined Type'.
    The Alert then fired successfully.
    Regards.
    Julie

  • Approval template not working on update

    Dear All,
    I created an approval procedure to check line discounts >=25% on marketing documents. I used the below query;
    'SELECT DISTINCT 'TRUE' WHERE $[$38.15.NUMBER]>=25'
    On Adding new marketing documents the approval works well, BUT if i recall the same document and change the discount value then Update, the approval procedure does not work. When i open the query it returns TRUE based on that marketing document form.
    Could this be a bug or is there something that i am not doing correctly?
    I am on SAP Business One 9.1 PL05.
    Regards,
    G.W

    Hi,
    Approval procedure will not work for updated documents even if the query get correct result.
    This is standard system design for approval procedure.
    Thanks.

  • Custom Approval Templates

    Hi All,
    Is it possible to add UDO screen, to the Documents section of Approval Templates screen.  With this, I would like to add a custom approval template for my own screen / document.
    For Example:
    When I goto Administrator --> Approval --> Approval Templates --> Documents, I see a list of screen names, for which we can set custom Approval Templates.  Can I add any other screen, which is missing here (either a SAP screen or an Add-on screen)?

    I'm afraid this is not possible in current b1 system.
    This is because the Approval Template background logic are designed with hardcode. This makes it not possible for the users to integrate their own documents with the b1 Approval module.
    Possible workarounds are like adding own restrictions to certain document change and send an alert to the manager. However, these logics should be realized by the customer add-on itself, rather by the b1 approval module.

  • Change approval templates

    Why can't I change the approval template after i've inserted it?
    Eveything goes grey, and I can't change anything. I've just created it, so it's not that it's in use....
    I'm using SBO 2005B PL31
    Thanks!
    Dan Souza

    Once you include your user id (Manager in this case) in a approval template you will no longer be able to edit approvals.   The idea is if you have been added to a approval someone want to check your work, and if you could edit the approvals thenm you could take yourself out of the approval process and by pass the approval that some one set up for your idea.   So until you remove the manager id from the approval, that id will not be able to edit approvals.   So the key is not to add a super user like manager to any approvals
    Dan Love

  • Using a SQL data source and XML data source in the same template

    I am trying to develop a template for the Request for Quote report generated in Apps 11.5.10. I have loaded the data from the XML output into the template, but I am missing one field - I need the org_id from the po_headers table. Is it possible to use a sql data source (i.e., "select org_id from po_headers_all where po_header_id = [insert header_id from xml data]...") in addition to the xml data source to populate the template at runtime? When you use the Insert > SQL functionality is it static at the time the template is created, or does it call to the database at runtime? I've looked through all the docs I could find, but this isn't clear.
    Thanks for any help or suggestions you may have.
    Rhonda

    Hi Pablo
    Thats a tough one ... if you go custom with a data template you will at least get support on the data template functionality ie you have a problem when you try and build one. You will not get support on the query inside the data template as you might have gotten with the Oracle Report, well you could at least log a bug against development for a bad query.
    Eventually that Oracle Report will be converted by development anyway, theres an R12 project going on right now to switch the shipped OReports to data templates. AT this point you'll be fully supported again but:
    1. You have to have R12 and
    2. You'll need to wait for the patch
    On reflection, if you are confident enough in the query then Oracle will support you on its implementation within a data template. Going forward you may be able to swap out your DT and out in the Oracle one without too much effort.
    Regards, Tim

  • RRI from the web template

    Hi,
    I have a requirement where in I need to jump from source query to target query from the web template. Our source query is static and no navigation is allowed. So in analysis grid item, I had to remove navigation as option. When I do this, user cant remove anything from the report but the issue is when user right clicks, GOTO option is not available. when I un tick the navigation , GOTO is available.
    So my requirement is navigation should not be available but GOTO should be available in context menu.
    Thanks
    Annie

    Hi Arvind,
    Thanks for the reply.
    Even if i copy and use it in the wad, User can still take out few rows from the selection if i dont switchoff the navigation from the web template. When the user removes any row from the table, my result of the report will be wrong because report is based on condition. Hope i am clear
    Thanks
    Annie

  • To Delete Approval Templates

    hi
    i want to delete or make to set no active of one particular Approval template.but i am not able to delete also not able to make set no active also. pls sort out this problem.
    Befor i used  tat approval template , now i wanna to delete it but it saying like this "cannot remove,there are exixting authorizations based on current template "
    giri

    Hello,
    To remove or update an existing approval template, user need log in
    system with a super user account that is not the Originator of the
    approval template. Please note that the Originator of the approval
    template cannot remove or update himself.   
    Regards,
    Paul Finneran
    SAP Business One Forums Team

  • Approval Templates' terms - help needed

    Greetings, all!
               I'm having troubles understanding the approval template terms (Modules->Administration->Approval Procedures->Approval templates:: Approval Templates setup form->Terms tab->Terms grid).
               I think I know what the 'Total Document' and "Discount %" terms are but the rest are a haze to me.
               Could anyone tell me how these are evaluated against a sales order for example.
               Any help will be appreciated
    Regards, Yavor

    It would help..If you could be more specific on which other ones you need to understand
    Generally as the terms are worded..
    Deviation from Credit Limit - If you have the Credit limit defined in the BP Master, it would validate against it
    Deviation from Commitment - same as above about against Commitment limit
    Gross Profit % - Document level Gross Profit would be validated
    Discount % - Document level Discount would be validated
    Deviation from Budget - This is when you use Budgets and if the Document causes an deviation from budget for that period...

Maybe you are looking for

  • TS1398 How do I install a WIFI certificate on my iPhone 5S

    I can pick up my WIFI at home, but when I come to work, it says that the certificate is not verified, so I click verify, and it shows that I'm connected, i.e. the wireless icon, but I can't download any data, and can't even text, as I've turned off m

  • Errors trying to run Application

    When I run the app using "java classpath MainClass" I get error : null

  • I dont want TIFF files

    When I edit a Raw file from Lightroom in Photoshop it comes in as a TIFF. After editing I save the file as JPG for the web and save it to a folder on my hard drive. When I go back into Lightroom there is a new TIFF duplicate next to the RAW file. The

  • Exchange 2013 Hybrid with O365 - migrated user causes admin restart prompt for multiple other users

    Greetings!  We are in the process of doing some testing and migration in a hybrid deployment with Office365 and Exchange on premise. I just completed a migration for an on-premise user.  We have, so far, migrated 3 users in the IT department as initi

  • IDCS3 Separations Preview palette is blank

    One of my users is experiencing a problem with Separations Preview not displaying any plates. The palette is completely blank and all options are greyed out. Also, using keyboard shortcuts to access the plate previews doesn't do anything either. I ha