[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Routing approval based on total

Posted on 2011-03-07
2
Medium Priority
?
549 Views
Last Modified: 2013-12-18
Have a basic tracer that I need to add a little bit of validation. Need to add an If Then to take into account a new field that I am using to get a line item total. (lenovo_total) Also I am going to have 3 vendor options now on the form. (vendor) So basically I need to use the code below if the vendor = "L" and the lenovo total is greater than $500. This will route for approval on the order. If the order is less than $500 it will not require finance approval so it would just be a similar tracer to the user that the order has been submitted and is processing.
What is the best way to evaluate for the vendor ("L", "D" or "HP") and also do the total check on the price. I will end up with 6 possibilities, one for each vendor and on if over the defined limit and one if under that limit.
FIELD status:="Pending Approval";
FIELD submit_flag:="done";
FIELD submit_date:=@Today;
SendTo := approver;
CopyTo := "";
BlindCopyTo := bcc;
Subject := "Equipment Order for " + username_hidden + " requires your approval";
Remark := "An IBPC Admin Equipment Order has been entered for " + username_hidden + ". Your approval is required. Please click on the following link and approve or reject the request.";
@Prompt([Ok];"Order Received.";"Thank you for completing this order. Your order has been received and is pending approval.");
@MailSend(SendTo; CopyTo; BlindCopyTo; Subject; Remark; "";[IncludeDoclink]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])

Open in new window

0
Comment
Question by:jforget1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
mbonaci earned 2000 total points
ID: 35063914
Use normal nested @If-s:

@If( 	vendor = "L";
		@if( amount > 500; 
			@Do( series of functions for > 500 );
			@Do( series of functions for < 500 ) 
		);
	vendor = "D"; 
		@if( amount > 500; 
			@Do( series of functions for > 500 );
			@Do( series of functions for < 500 ) 
		);
	vendor = "HP"; 
		@if( amount > 500; 
			@Do( series of functions for > 500 );
			@Do( series of functions for < 500 ) 
		);
	@Prompt([OK]; "Unknown vendor"; "Please choose the vendor")
)

Open in new window



If you need to set field values inside @Do, then instead of
FIELD status:="Pending Approval";

Open in new window

use
@SetField( "status"; "Pending Approval" )

Open in new window

0
 

Author Comment

by:jforget1
ID: 35068858
Excellent this is exactly what I needed. Was having trouble with the syntax logic on this one. Thanks for the help as usual.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question