Amal Vellappillil

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 61 total)
  • Author
    Posts
  • in reply to: Is equal to and changed from initial value operator #32863
    Amal Vellappillil
    Participant

      Hi Alex,

      Yes that would work also. However, as you can imagine if we have 20 rules or so, that means we will need another 20 rules to make it work. Its better to use customJS at that point to check if the value changed based on the ruleID and triggerField.

      Do you think this can be a feature added to a future release? A new operator or a checkbox next to the operator dropdown asking “is changed from initial value”? I think it will help.

      Thank you for taking the time to provide a solution.

      -Amal Vellappillil

      in reply to: spjs.utility.addItem creating 2 entries when called #32856
      Amal Vellappillil
      Participant

        Glad you are able to look into this and possibly skip duplicate calls to presaveaction method. It would be nice if the library could handle the logic than users remembering the little quirk and do the workaround on each and every form.

        in reply to: General DFFS enhancement suggestions #32854
        Amal Vellappillil
        Participant

          Sounds good to me 🙂

          in reply to: General DFFS enhancement suggestions #32848
          Amal Vellappillil
          Participant

            Hi Alex,

            I have a suggestion/enhancement request. I noticed that it would be very helpful to have all the field names available as intellisense in Ace editor. So I added this to your “aceAutocomplete” function inside DFFS_backend js file.

            var fieldNamesCompleter = {
                                getCompletions: function(editor, session, pos, prefix, callback) {
                                    var wordList = spjs.dffs.data.listFieldsArr.map((f) => f.fin + "|" + f.disp + "|" + f.type); 
                                    callback(null, wordList.map((word) => {
                                        var wordArr = word.split("|");
                                        return {
                                            caption: wordArr[1] + " - " + wordArr[2],
                                            value: wordArr[0],
                                            meta: "listField"
                                        };
                                    }));
                            
                                }
                            }
                            a.completers.push(fieldNamesCompleter);

            This code was added inside the else block where you are setting enableBasicAutocompletion: true. You can use this as is or modify to your willing to adapt to your coding styles. I hope this gets added to the future versions of DFFS.

            Thank you,
            Amal Vellappillil

            in reply to: spjs.utility.addItem creating 2 entries when called #32835
            Amal Vellappillil
            Participant

              So I put debugger at the top of the presaveaction function and sure enough it got hit twice. So I still dont understand what is causing it to be called twice, but the workaround you mentioned skips the item creation the second time around.

              Thank you so much for the workaround and tips on debugging.

              in reply to: DFFS_Email List at site collection level #32828
              Amal Vellappillil
              Participant

                Hi Alex,

                Thank you for the quick turn around. I will give it a go.

                – Amal Vellappillil

                in reply to: DFFS_Email List at site collection level #32811
                Amal Vellappillil
                Participant

                  Hi Alex,

                  That would be awesome!

                  Thank you,
                  Amal Vellappillil

                  in reply to: How to copy clues created in newform to editform #31353
                  Amal Vellappillil
                  Participant

                    See attachment below. Hope it helps.

                    in reply to: Date Field Format #30774
                    Amal Vellappillil
                    Participant

                      try this

                      {ReleaseDate['MMMM dd, yyyy']}
                      in reply to: Detect any change in an EditForm #30676
                      Amal Vellappillil
                      Participant

                        Thank you for taking the time to explain the difference.

                        in reply to: Detect any change in an EditForm #30667
                        Amal Vellappillil
                        Participant

                          Hi Alex,

                          Thank you so much for the snippet.
                          Just out of curiosity. What is the difference between the way you have it vs comparing between beforeProperties and getFieldValue?

                          spjs.dffs.beforeProperties[fin] !== getFieldValue(fin)

                          -Amal Vellappillil

                          in reply to: Stop scheduled email not working #30527
                          Amal Vellappillil
                          Participant

                            Hi Alex,

                            Thank you for getting back so quickly. I will use this workaround till a proper fix is released.

                            Thank you,
                            Amal Vellappillil

                            in reply to: Rule validation along with javascript validaton #29692
                            Amal Vellappillil
                            Participant

                              Awesome. Thank you so much for all the clarifications and directions.

                              Stay safe.

                              in reply to: Rule validation along with javascript validaton #29655
                              Amal Vellappillil
                              Participant

                                Hi Alex,

                                Thank you very much for clarifying the fact about JS in “Run these functions/evaluate these rules” does not have an impact on rule validation.

                                I have been using a generic version of what you had mentioned in your post with another list. I just thought about asking this question and see if there was a better way of getting this done. Here is the sample code. Just putting it out there just in case if it is helpful for others.

                                
                                
                                function queueEmailToBeSent(ruleID) {
                                    var initval, val, rule;
                                    
                                    jQspjs.each(spjs.dffs.ruleObj.ruleArr, function (k, v) {
                                        if (v.friendlyName === ruleID) {
                                            rule = v;
                                        }
                                    });
                                
                                    if (!jQspjs.isEmptyObject(rule)) {
                                        var field = rule.triggerField;
                                        var type = spjs.dffs.fieldtype[field];
                                
                                        initVal = spjs.dffs.beforeProperties[field];
                                        val = getFieldValue(field);
                                
                                        if (type === "SPFieldBoolean") {
                                            if (val !== initVal && val) {
                                                spjs.dffs.handleEmailTemplate(ruleID, true);
                                            } else {
                                                spjs.dffs.handleEmailTemplate(ruleID, false);
                                            }
                                        }
                                        else
                                        {
                                            if (val !== initVal && !jQspjs.isEmptyObject(val)) {
                                                spjs.dffs.handleEmailTemplate(ruleID, true);
                                            } else {
                                                spjs.dffs.handleEmailTemplate(ruleID, false);
                                            }
                                        }
                                    }
                                }

                                As a follow up can you answer these as well?
                                1. Is it possible to find out if a rule is validated or not using JS?
                                2. Is it possible to manually evaluate a rule from within JS?

                                Thank you for all your help.

                                in reply to: Validation utility available? #27975
                                Amal Vellappillil
                                Participant

                                  Thank you for the confirmation Alex.

                                Viewing 15 posts - 31 through 45 (of 61 total)