This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// for browsers := get local db data and write on a file as a backup and download that on the devise | |
var db = Lawnchair( { name:'QFlocalStorage', adapter: localStorage.getItem("f_db_adapter") }, function( store ) {}); | |
//Event listener | |
window.addEventListener('online', function(event){ | |
var draft_entry = []; | |
var collection_keys = []; | |
var updated_data = []; | |
//Get all the entries id from local db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for browsers := get local db data and write on a file as a backup and download that on the devise | |
var db = Lawnchair( { name:'QFlocalStorage', adapter: localStorage.getItem("f_db_adapter") }, function( store ) { | |
}); | |
var collection_keys = []; | |
//Get all the entries id from local db | |
db.keys(function(keys) { | |
//Collect ids | |
collection_keys = _.filter(keys, function(key) { | |
return (new RegExp('forms-')).test(key); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.finish').on('click', function(e) { | |
e.stopImmediatePropagation(); | |
//Off the click event | |
$('.finish').off('click'); | |
var first_name = formyoula.form_fields['ccee-a073-3d63'].get('value'); | |
var last_name = formyoula.form_fields["2e65-9fb3-0133"].get('value') | |
var user_data = [ | |
{ | |
"typeId":"319013", | |
"externalId": "000000002", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Static records | |
var record_ids = ['000000002','000000001']; | |
//Contact Data | |
var contact_data = null; | |
// Generic function to make an AJAX call | |
var DFG_Get_Entity = function(user_token ,record_ids) { | |
// Return the $.ajax promise | |
return $.ajax({ | |
url: 'https://test.dfg152.ru:8443/dfg-rest/entity/batch/get', | |
cors: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This event trigger on Salesforce Table data render | |
//Please replace the component-id/merge-id | |
formyoula.form_fields["598a-89a0-b2ba"].on("table:results:render:rowCallback", function(row) { | |
//Get all the table data. | |
var table_data = $("#salesforce_table_598a-89a0-b2ba").DataTable().data().toArray(); | |
//Check for table data | |
if(table_data.length){ | |
//Init the temp variable for calculation | |
var total_quantity = 0; | |
//Loop on table data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*formyoula.form_fields["cf69-4c7b-6390"].on("input:set:success", function(e){ | |
formyoula.form_fields["cf69-4c7b-6390"].trigger("change") | |
})*/ | |
//formyoula.form_fields["cf69-4c7b-6390"].on("all", function(e){ | |
//console.log(e); | |
//console.log($("#component-fd56-b750-3c0b input.input_content").val()); | |
/*$("#component-fd56-b750-3c0b input").val().each(function(key, val){ | |
console.log(key); | |
console.log(val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SF table component - id | |
var component_id = "12da-62aa-a8dc"; | |
// on table render event | |
formyoula.form_fields[component_id ].on("table:results:render:rowCallback",function(){ | |
update_input_field(); | |
}) | |
//Check on table render success event | |
formyoula.form_fields[component_id ].on("table:results:render:success",function(){ | |
console.log("rendered*****"); | |
update_input_field(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Hidden field | |
formyoula.form_fields['4556-bd6d-675d'].on("change",function(){ | |
//Get img url - from hidden field | |
var img_url = formyoula.form_fields['4556-bd6d-675d'].get('value'); | |
//check if there is URL | |
if(img_url.match("http")) { | |
//Hide the signature element | |
$("#component-30c1-3ddb-39d4").hide(); | |
//Set Img URL to Formyoula HTML element - This is an HTML element | |
$("#component-8d9a-5809-dd75").html(img_url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.finish').on('click', function(e) { | |
e.stopImmediatePropagation(); | |
//Check password and throw alert if not == "Welcome@123" | |
if ( formyoula.form_fields['554e-c74b-f697'].get('value') == "Welcome@123") { | |
$('.finish').off('click'); | |
$(this).click(); | |
} else { | |
alert('Warning : Invalid Password !!'); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("body.div.alert.alert-danger.alert-dismissible").hide(); | |
var is_sales_orders = false; | |
var is_marketing_early_pay = false; | |
var is_marketing_totals = false; | |
var is_discretionary = true; | |
var is_pricelineAmountSum = false; |