Jump to content

Using an XDF to Auto Populate, but need to also be customizeable


Recommended Posts

Posted

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;

Posted

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");

Posted
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"));

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...