Jump to content

JMR21

Members
  • Posts

    17
  • Joined

  • Last visited

JMR21's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. @sandy159Thank you for your response. I had previously tried the Edit Record without luck but I tried it again as you suggested. It still doesn't work. Also, I have to leave the fields as text fields because I have rules created and the rules are only working when they are formatted as text fields. Any other ideas? Thanks!
  2. @Vitalikssssss I'm doing another page related to this same topic... I have a datapage that calculates a summary of purchases, credits, discounts, payments, and net due. In the course of this, I have had to make my "sale credit, volume discount, and repeat buyer discount" fields as TEXT FIELDS in the datapage elements so that the rules will function correctly and hide any of these sections that are NOT present. The rules are working correctly now that I have made them text fields but I can't get my js to work to format them as currency in the report page. I tried the above coding in my footer but it doesn't work. Any ideas? Here are some screen shots: ------------------------------------------------------------ My js in footer of the datpage: <script> document.addEventListener('DataPageReady', assignEvent); function formatAsDollars(el) { el.value = el.value.replace(/[^\d]/g,'').replace(/(\d\d?)$/,'$1').replace(/^0+/,'').replace( /\d{1,3}(?=(\d{3})+(?!\d))/g , "$&,"); el.value = el.value ? '$' + el.value : ''; } function assignEvent(){ let fields = ["tblCustomerInfo_SaleCreditUsed", "tblCustomerInfo_VolumeDiscount_dollars", "tblCustomerInfo_RepeatBuyerDisct_dollars"]; //specify your fields here fields.forEach(element => { element = "InsertRecord" + element; // replace "InsertRecord" with "EditRecord" for Details/Single Record Update DP document.getElementById(element).onkeyup = function() { formatAsDollars(this); } document.getElementById(element).onchange= function() { formatAsDollars(this); } }); } </script> -------------------------------------------------------------- This is what the report looks like without the currency formatting:
  3. I ran into the same problem recently. I was able to do a work-around by inserting a virtual field in my datapage and setting it as a calculated field. Then I inserted a SELECT statement. Here is my example: SELECT SUM((tblSaleInfo_Price)*(tblSaleInfo_ShareOwnership1)) FROM _v_BuyerID_SaleInfo WHERE tblCustomerInfo_BuyerID = target.[@field:BuyerID] AND tblSaleInfo_Client = '[@authfield:Client]' In this case I am doing a calculation of two fields within a view where I select a for a certain Buyer ID and it has to meet the Client authentication field. Hope this helps!
  4. I am passing field values to an html datapage hosted on my website to create an invoice. Anytime there was a "#" included in an address, it would stop all the information following that point. I have incorporated the code from above and it does pass it on, but now I am getting "%20" anywhere there should be a space and "%23" where the # is included. Below is my code that I created from the examples on another help forum here. Do you see where I am creating this problem? I'm hoping it's something obvious! <a href="#" id="link-1">VIEW INVOICE</a> <script> // DO NOT TOUCH FROM THIS POINT var params = []; addParameter = function(qs, val){ params.push(`${qs}=${encodeURIComponent(val)}`); } //UP TO THIS POINT var link_id = "link-1"; var base_url = "https://janetrippe.com/invoice.html"; addParameter('fn', '[@field:FirstName]'); addParameter('ln', '[@field:LastName]'); addParameter('frn', '[@field:FarmRanchName]'); addParameter('ad1', '[@field:MailingAddress]'); addParameter('City', '[@field:City]'); addParameter('State', '[@field:State]'); addParameter('Zip', '[@field:Zip]'); addParameter('Phone1', '[@field:Phone1]'); addParameter('Phone1C', '[@field:Phone1Contact]'); addParameter('Phone2', '[@field:Phone2]'); addParameter('Phone2C', '[@field:Phone2Contact]'); addParameter('DA', '[@field:DeliveryAddress]'); addParameter('DC', '[@field:DeliveryDateComments]'); addParameter('DD', '[@field:BullDeliveryDate]'); addParameter('AAA', '[@field:AAAMemberCode]'); addParameter('Bid', '[@field:BuyerID]'); addParameter('TN', '[@field:TransferName]'); addParameter('Code', '[@field:AIMSid#]'); // DO NOT TOUCH FROM THIS POINT var queryString = params.join("&"); document.querySelector(`#${link_id}`).href = `${base_url}?${params.join("&")}` //UP TO THIS POINT </script> Here is a sample of what it is pulling; I have a # sign in the address as '4800 #1 Black Horse Pike'; it actually changed the # sign to %23 and the spaces to %20 Thanks so much for your help!!
  5. @Vitalikssssss I am doing something very similar to what is described above as I am passing field values to a link on my web page to create an invoice. Anytime there was a "#" included in an address, it would stop all the information following that point. I have incorporated the code from above and it does pass it on, but now I am getting "%20" anywhere there should be a space and "%23" where the # is included. Below is my code that I created from the examples above. Do you see where I am creating this problem? I'm hoping it's something obvious! <a href="#" id="link-1">VIEW INVOICE</a> <script> // DO NOT TOUCH FROM THIS POINT var params = []; addParameter = function(qs, val){ params.push(`${qs}=${encodeURIComponent(val)}`); } //UP TO THIS POINT var link_id = "link-1"; var base_url = "https://janetrippe.com/invoice.html"; addParameter('fn', '[@field:FirstName]'); addParameter('ln', '[@field:LastName]'); addParameter('frn', '[@field:FarmRanchName]'); addParameter('ad1', '[@field:MailingAddress]'); addParameter('City', '[@field:City]'); addParameter('State', '[@field:State]'); addParameter('Zip', '[@field:Zip]'); addParameter('Phone1', '[@field:Phone1]'); addParameter('Phone1C', '[@field:Phone1Contact]'); addParameter('Phone2', '[@field:Phone2]'); addParameter('Phone2C', '[@field:Phone2Contact]'); addParameter('DA', '[@field:DeliveryAddress]'); addParameter('DC', '[@field:DeliveryDateComments]'); addParameter('DD', '[@field:BullDeliveryDate]'); addParameter('AAA', '[@field:AAAMemberCode]'); addParameter('Bid', '[@field:BuyerID]'); addParameter('TN', '[@field:TransferName]'); addParameter('Code', '[@field:AIMSid#]'); // DO NOT TOUCH FROM THIS POINT var queryString = params.join("&"); document.querySelector(`#${link_id}`).href = `${base_url}?${params.join("&")}` //UP TO THIS POINT </script> Here is a sample of what it is pulling; I have a # sign in the address as '4800 #1 Black Horse Pike'; it actually changed the # sign to %23 and the spaces to %20 Thanks so much for your help!! Janet
  6. @VitalikssssssThank you so much for the help!
  7. I have several datapages all embedded on a single web page. They use different tables and views and they are all connected via a search parameter that is passed on to each of them. To make sure the user updates each section as they move along and therefore update all the appropriate calculations and references, I would like to use javascript that will essentially keep the next section hidden until they update. Is there some code that accomplishes the "on click of button, unhide next datapage"? Thank you for any help you might have!
  8. @TellMeWhyThank you. Those were great articles. It didn't solve my problem but it gave me some new ideas! Thanks again for the reply!
  9. I have an aggregate value calculated (sum of purchases) on a report for a given customer. I would like to use that value in a separate pymt summary datapage that would show the total purchases. Is it possible to pass that parameter on if it is not a field in the table?
  10. Like @jasonkaeb, I am passing parameters from a search form onto 3 other data pages that are receiving the external parameter. The form as well as the 3 resulting datapages all load on the same web page. The above coding helped me get the form to clear with a reset button but the previous search data remains in the other data pages that are receiving the external parameter. I'm not sure if I am missing some coding or perhaps have it placed in the wrong location? Any help is greatly appreciated!!
  11. @Vitalikssssss Oh my gosh! You're amazing! Thank you soooo much! This worked perfectly!!
  12. @Vitalikssssss I used this to edit a single record on the details page and it works perfect for my first record entry but then it doesn't work on the rest of the records that follow. Do I need to add something else or place it differently? I tried in the footer as well as inserting an HTML block before and after my "Price" field. Thanks in advance for the help!
×
×
  • Create New...