Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[FMP-If: CurrentRecordNumber ] Greater and less

Featured Replies

Is there a way to set a range in an if statement?

I am trying to break the results into different columns so:

0-4 in column 1

5-8 in column 2

9-12 in column 3

Hi, If you want to display a search in columns, the easiest way is to use inlines and the 'skip' function. In your example, set a max of 4 for your initial search, then

column 2: Inline with ,-skip="4",-max="4",

column3:Inline with ,-skip="8",-max="4",

etc. (i think you do need those quotes around the numbers)

You can then use the "Currentfind" "FindFieldItem", "FindValueItem" tags to build the Inline searches.

regards, jeff

PS: the knowledgable on the list can do this is javascript instead, but this is the quick-an'-dirty easy way.

Here is a javascript method I have used to produce three columns of names which are ordered alphabetically down the colums.

	<script language="Javascript">

	var i = 0;

	var aCustomers = new Array();

	var aCustomerIDs = new Array();

	var iCustCount = [FMP-CurrentFoundCount] ;

	var rows = Math.ceil(iCustCount / 3) ;

[FMP-Record]

	aCustomers[i] = "[FMP-Field:cust_name, raw]" ;

	aCustomerIDs[i] = "[FMP-Field:cust_id]" ;

	i += 1 ;

[/FMP-Record]

	function addbusiness(cust)

	   {

	      var cust ;

	      document.newquotefm.cust_id.value = cust ;

	      document.newquotefm.submit() ;

	   }

	</script>

</head>

<body><form name="newquotefm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post'>

<input type="hidden" name="-db" value="quotes.fp5">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-format" value="/digi_lan/editquote.html">

<input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]">

<input type="hidden" name="-token.1" value="[FMP-CurrentToken:1]">

<input type="hidden" name="-token.2" value="[FMP-CurrentToken:2]">

<input type="hidden" name="prepared_by" value="[FMP-ClientUsername]">

<input type="hidden" name="cust_id">

<input type="hidden" name="-new">

Click on a Customer Name for new quote:

<table>

<script>

for(j = 0; j< rows; j++)

	{

	document.write("<tr><td><a href=Javascript:addbusiness('" + aCustomerIDs[j] + "');>" + aCustomers[j] + "</a></td>");

	document.write("<td><a href=Javascript:addbusiness('" + aCustomerIDs[j + rows] + "');>" + aCustomers[j + rows] + "</a></td>");

	document.write("<td><a href=Javascript:addbusiness('" + ((aCustomerIDs[j + (2 * rows)] === (void 0)) ? '':(aCustomerIDs[j + (2 * rows)])) + "');>" + ((aCustomers[j + (2 * rows)] === (void 0)) ? '':(aCustomers[j + (2 * rows)])) + "</a></td></tr>");

	}

</script>

</table></body>

Hope this is of interest.

Garry

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.