epryser Posted August 19, 2019 Posted August 19, 2019 Good morning! I have several rules that call for auto-population based on an XDF file. they are working just fine! However, the customer would also like to make a few of them customizeable, in case the auto-populated address, for example, is outdated. How do I handle that? Here is an example of one of the rules currently being used: ___________________________________________ Rule("OnJobStart"); var address= ""; for (i = 1; i < My_File.recordCount+1;i++) { if(Field("company10").indexOf(My_File.GetFieldValue(i,0)) > -1){ address = My_File.GetFieldValue(i, 3); break; } } return address; Quote
jimmyhartington Posted August 20, 2019 Posted August 20, 2019 You could create a manual field for the users address. Then check if this is empty use the XDF else use the manual entered. Quote
jimmyhartington Posted August 20, 2019 Posted August 20, 2019 In one case I have a customer, which can choose an address from a dropdown or enter it themselves. If nothing it chosen the address is taken from a Text Profile Attribute. Rembember you can reference rules in other rules. So my rule for choosing the address looks like this. if (Field("Site dropdown") == "" && Field("Manual site address") == "") return Rule("R_Site from user v2"); else if (Field("Manual site address") != "") return Field("Manual site address") else return Rule("R_Site drop down-v2"); Quote
Dan Korn Posted August 20, 2019 Posted August 20, 2019 In one case I have a customer, which can choose an address from a dropdown or enter it themselves. If nothing it chosen the address is taken from a Text Profile Attribute. Thanks, that's a good suggestion. It's also confirmation that this entire thread belongs in the MarcomCentral app sub-forum. Rembember you can reference rules in other rules. Yes, that's one of the ways to use layers of variability. So my rule for choosing the address looks like this. if (Field("Site dropdown") == "" && Field("Manual site address") == "") return Rule("R_Site from user v2"); else if (Field("Manual site address") != "") return Field("Manual site address") else return Rule("R_Site drop down-v2"); That could be reworked as: return Field("Manual site address") || (Field("Site dropdown") ? Rule("R_Site drop down-v2") : Rule("R_Site from user v2")); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.