Skip to content

Instantly share code, notes, and snippets.

View anil826's full-sized avatar
🏠
Working from home

Anil anil826

🏠
Working from home
  • New Delhi , India
View GitHub Profile
@anil826
anil826 / htmlbackup.html
Created December 27, 2019 16:19
pramodHTMLbackup
<p style="text-align: center;"><span style="font-size:16px;"><strong>E - Formul&aacute;ř pro GDPR {{0f47-1f31-3c62}}</strong></span></p>
<table cellpadding="0" cellspacing="0" style="width: auto; margin-left: auto; margin-right: auto;">
<tbody>
<tr>
<td style="width: auto;"><strong><span style="color: #008000;">Poučen&iacute; o zpracov&aacute;n&iacute; osobn&iacute;ch &uacute;dajů a souhlas s jejich zpracov&aacute;n&iacute;m</span></strong></td>
</tr>
<tr>
<td style="width: auto;">
<p>&nbsp;<strong>Spr&aacute;vce osobn&iacute;ch &uacute;dajů</strong> je Syngenta Czech s.r.o., IČO: 45146365, se s&iacute;dlem Bucharova 1423/6, 158 00 Praha 5 &ndash; Stodůlky, zapsan&aacute; v obchodn&iacute;m rejstř&iacute;ku veden&eacute;m Městsk&yacute;m soudem v Praze, odd&iacute;l C, vložka č. 8308, e-mail: syn.info@syngenta.com, webov&aacute; str&aacute;nka: <a href="https://www.syngenta.cz/">https://www.syngenta.cz/</a></p>
@anil826
anil826 / sample.js
Last active November 15, 2019 16:17
Sample code for Qty calcuation 2 different table
formyoula.form_fields['50a7-888a-450e'].on("table:results:render:success",function(r){
//Hide the product id coloum
$("#salesforce_table_2f7b-db31-bc5b").DataTable().column(4).visible(false);
$("#salesforce_table_50a7-888a-450e").DataTable().column(7).visible(false)
//First table
var parent_table = $("#salesforce_table_2f7b-db31-bc5b").DataTable();
//second table
var child_table = $("#salesforce_table_50a7-888a-450e").DataTable();
//Get all the table data
var parent_table_data = parent_table.rows().data().toArray()
@anil826
anil826 / DFGoffline.js
Last active November 14, 2019 08:44
new
<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
@anil826
anil826 / draftEntry.js
Created November 5, 2019 12:27
DFG server offline
// 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);
});
@anil826
anil826 / SygentaDFGUpdate.js
Created November 4, 2019 08:25
Update Save record on DFD
$('.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",
@anil826
anil826 / gist:a0e0f80822c3e710fea51aa8061979ef
Last active October 30, 2019 05:43
DFG Intergration Contact
//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,
@anil826
anil826 / calculation_specific_row_sf_table.js
Created October 11, 2019 16:18
Data Table row calculation
//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
@anil826
anil826 / backup-dinesh-repeat_issue.js
Created September 25, 2019 11:54
backup-dinesh-repeat_issue
/*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);
@anil826
anil826 / sf_table_regex.js
Created September 12, 2019 07:34
SF Table validaion for Phone number based on regex
//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();
@anil826
anil826 / signature.js
Created September 6, 2019 13:20
Graham Check signature
//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);