Vidya

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: General DFFS enhancement suggestions #29796
    Vidya
    Participant

      Hi Alex,

      I have a form , on click of a button it calls an API.
      The response value from API needs to be set into a hidden field on the form which needs to be saved to my custom list data. I am calling the save after calling the API.

      Attached is the customJS file. I need help in reading the return value from API call and saving it to the list.

      Can you help?

      Thanks,
      Vidya

      Attachments:
      in reply to: Pop up Messages of Error on Save #29793
      Vidya
      Participant

        Hi Alex,

        How can I debug the Custom JS? I am not able to find the script in the Chrome debugger.

        Thanks,
        Vidya

        in reply to: Check required fields on html Button click event #29778
        Vidya
        Participant

          Hi Alex,

          We are calling a custom Workflow on click of buttons on the form, i have 5 buttons amogng two tabs. When a button is clicked a dropdown value of status need to be updated and an API needs to be called.

          How can I set a field which is of type Choice – Drop Down, Can you please help me with the syntax. I saw syntax for Radio Button but couldnt find for DropDown in the manual.

          ALso any tips on debugging the custom JS in Chrome? Had a hard time finidng control/scripts on the newform.aspx page. Had to use alerts to debug.

          Thanks,
          Vidya

          in reply to: Check required fields on html Button click event #29776
          Vidya
          Participant

            Hi Alex,

            Below is my custom code, I have a HTML button called Save as draft and on click of it i am calling an API which, after the API call is done the page is submitting itself and refreshing. How can i stop the page from doing it? I am not even using the default save button.

            $(“input[id$=’diidIOSaveItem’]”).hide();
            $(“input[id$=’diidIOGoBack’]”).hide();

            $(“button[id$=’btnSave’]”).click(function(){
            alert(“Save Draft Button clicked”);
            });

            function SaveAsDraftButtonClicked()
            {

            var auth = btoa(‘username:pwd’);
            alert(” Inside Button Click”+auth);
            $.ajax({
            type: ‘GET’,
            url: ‘SomeURL’,
            headers: {
            “Authorization”: “Basic ” + auth
            },

            success : function(data) {
            console.log(data);

            alert(data.id);

            },
            });
            alert(“After calling the API”);

            return false;
            }

            in reply to: Check required fields on html Button click event #29694
            Vidya
            Participant

              Hi Alex,

              Here is my code to call an API, I get a valid response from the browser but this call from Custom JS is not working. I am not sure what is wrong. send () is the function called on clicking a HTML button, The required fields should be validated , a field shud be set and an API call should be made.

              function send()
              {
              alert(‘Inside Send function’)

              var urlvariable;

              urlvariable = “URL goes here”;

              var ItemJSON;

              URL = urlvariable;

              var xmlhttp = new XMLHttpRequest();
              xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
              xmlhttp.open(“POST”, URL, false);
              xmlhttp.setRequestHeader(“Content-Type”, “application/json”);
              xmlhttp.setRequestHeader(‘Authorization’, ‘Basic ‘ + window.btoa(‘username:pwd’)); //in prod, you should encrypt user name and password and provide encrypted keys here instead
              xmlhttp.onreadystatechange = callbackFunction(xmlhttp);

              xmlhttp.send();
              alert( “Response Text : ” + xmlhttp.responseText);
              // document.getElementById(“div”).innerHTML = xmlhttp.statusText + “:” + xmlhttp.status + “<BR><textarea rows=’100′ cols=’100′>” + xmlhttp.responseText + “</textarea>”;
              }

              function callbackFunction(xmlhttp)
              {
              alert(“Response Text : ” + xmlhttp.responseXML);
              $(“input[id$=’SaveItem’]:first”).trigger(“click”);
              }

              in reply to: spjs.dffs.dlgBox vs. browser alert #29678
              Vidya
              Participant

                Hi ALex,

                I need your help in finding out how to update fields in custom JS.

                I have a form with two buttons, “Save as draft” and “Submit”, I have added them as HTML buttons on form and have hidden the defaut save and cancel button.

                I have a multichoice field called Status in my custom list. This value gets updated on click of buttons on my form.

                When Save as draft button is clicked, I should have my Multi choice field ” Status” to be set as “Pending Submission”

                This is my button html and custom JS

                <button onclick=” SaveAsDraftButtonClicked()”>Save as Draft</button>

                function SaveAsDraftButtonClicked()
                {

                alert(‘Save as Draft Button is CLicked’);
                }

                I also need to call a JBPM workflow API passing crendiatls after button click.
                Can you please help me with the custom code for it.

                in reply to: Show this text above the tabs #28187
                Vidya
                Participant

                  Thank you!

                  in reply to: Using Created and Created By in Forms #28158
                  Vidya
                  Participant

                    Yes i was….sigh…thank you!

                    in reply to: Using Created and Created By in Forms #28151
                    Vidya
                    Participant

                      Hi Alexander,

                      I tried the above customJS and getting this error, please see attched.

                      Thanks,
                      Vidya

                      in reply to: Example of Cascading dropdown #28097
                      Vidya
                      Participant

                        Thank you, i was able to get them working.

                        in reply to: Example of Cascading dropdown #28087
                        Vidya
                        Participant

                          yes i did, i tried and it didn’t work. Here is what i have done. I cannot show the real lists due to confidentiality.

                          My Base List Column
                          EMployeeName, EMployeeAddress, EmployeeState, EmployeeCity

                          My lookup list is similar to a State , city list. So i have list columns named State and City, with Values NJ, PA and MA and a City column with Values Trenton, Newark, Jersey City, Philadelphia, Boston etc

                          State City
                          NJ Trenton
                          NJ Trenton
                          PA Philadelphia
                          MA Boston

                          Comma separated list of fields in the lookup list
                          InternalNameforState, InternalNameForCity

                          Comma separated list of fields in the current list
                          InternalNameforEmployeeState,InternalNameforEmployeeCity

                        Viewing 11 posts - 1 through 11 (of 11 total)