Conditional Statements

Discussion created by Jason_Farnsworth on Nov 30, 2011
Latest reply on Nov 30, 2011 by Jason_Farnsworth

I am currently performing a loop function and it is working rather nicely, but I need to add a little complexity to it.


1. There is a senerio when it is looping and performing a find that is cant find the data because it doesnt exist. It stops the script. Would I use and IF statement to get around that? I have looked at them they ask for a calculation. I am not sure how to word this calculation? Basicly if nothing is in the field move on with the loop is what I want.


2. I am collecting data from two tables during this loop

Table 1 Process ID,LineItemID, VendorID and Vendor Tier

Table 2 MaterialID,LineItemID, VendorID and Vendor Tier

Then I go out and create a new lineitem in different BidReq table and push all the data to that lineitem. Currently I am only Pushing Data from the Table 1. This was to test the loop and its results.


I need to add the Info from Table 2 which is easy to do via another loop. However there might be some doubling up of the info, for instance The ProcessID might have the same VendorID and Vendor Tier as the MaterialID does for the same lineItemID. So if I go out and just create another loop it will simple just create a new BIDREQ lineItemsID. This will give me two of the same Vendor for Single LineItem (of the main form) if they have matching data.


So how do I look for multiple vendors on the same LineItem? Then once found remove all but one? So when I do my printed report it does double the requests. Or is it better to catch the double up before it creates the new record? I would think before it creates the record to avoid having to delete anything. But I think I am back the the IF Statements to resovle it.


Thanks again,