Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var visit_form_filter = '';
- window.formyoula.form_fields["e838-d8cd-04b4"].on("change", function(e){
- if(this.get("value")){
- visit_form_filter = "Visit__c = '" + window.formyoula.form_fields["e838-d8cd-04b4"].get("value") + "'";
- window.formyoula.form_fields["5d08-df52-e0bd"].set("sfdc_filter_fields", visit_form_filter);
- }
- });
- function process_Section_Order(){
- var header_Text = '';
- var parent_Component_Id_href = '';
- $('.panel.panel-default.existing_repeat_entry_panel').sort(function (a, b) {
- return $(a).find('#component-c3fa-e967-e44d .form-control.input_content.c3fa-e967-e44d').val() - $(b).find('#component-c3fa-e967-e44d .form-control.input_content.c3fa-e967-e44d').val();
- }).each(function (_, container) {
- var component_Id_href = $(container).find(".panel-heading").attr('href');
- var component_Id = component_Id_href.substring(1);
- var selectList = $(component_Id_href).find('#component-ad62-b551-da2f .input_content.form-control');
- var individual_Question_Picklist_Value = $(component_Id_href+" #component-5177-493d-9b00 .input_content").val() ? ($(component_Id_href+" #component-5177-493d-9b00 .input_content").val().split(',')) : '';
- $(selectList).empty();
- $(selectList).append($("<option></option>").attr("value",'').text('-- None --'));
- $.each(individual_Question_Picklist_Value, function(key, value) {
- $(selectList)
- .append($("<option></option>")
- .attr("value",value)
- .text(value));
- });
- $("a[href='" + component_Id_href + "']").get(0).innerText = $(component_Id_href+" #component-fe80-fcbc-17df .input_content").val()
- if(header_Text != $("a[href='" + component_Id_href + "']").get(0).innerText){
- header_Text = $("a[href='" + component_Id_href + "']").get(0).innerText;
- parent_Component_Id_href = component_Id_href;
- }else{
- $(component_Id_href + " .panel-body").appendTo( $(parent_Component_Id_href) );
- $("div[href='" + component_Id_href + "']").closest( ".panel.panel-default.existing_repeat_entry_panel" ).remove();
- }
- $(container).parent().append(container);
- });
- }
- $(".finish").on("click", function() {
- setTimeout(function(){
- window.open('salesforce1://sObject/' + window.formyoula.form_fields["e838-d8cd-04b4"].get("value") + '/view', '_system', 'location=yes');
- },1000);
- })
- $( document ).ajaxComplete(function( event, xhr, settings ) {
- if ( settings.url.search("/api/salesforce/objects/Form_Question__c/records") > -1 ) {
- $('body').append('<div class="custom-loader"><div class="whirl traditional"><div class="spinner-dialog"><span class="spinner-dialog-title">Executing Custome JavaScript</span> <br/><span>Please wait...</span> <br/></div></div></div>');
- $(this).ajaxStop(function(){
- process_Section_Order();
- $('.custom-loader').remove();
- });
- }
- });
Add Comment
Please, Sign In to add comment