AddCustomAltDataButton Method

Purpose

The Alternative Data Button is the "+" (plus sign) next to a block of fields that contain alternate data. When the user clicks this button the Choose Alternate Data popup appears with the list of available records to choose from. By default, every client record output to the form (not just Owner1) will appear, including rep information. The user then clicks the desired record and that data is inserted into the data block on the form.

For more information on how to configure Alt Data Buttons, see here.

Sample Code

Suppose we want to add a custom button next to the field 1own.H.Addr123, that will allow the user to populate all Home Address related fields. And let's say the related fields are:

  • 1own.H.Addr123
  • 1own.H.Addr4
  • 1own.H.City
  • 1own.H.State
  • 1own.H.Zip
  • 1own.H.Country

 

The way to accomplish this is by calling the AddCustomAltDataButton method, and passing a CustomAltButton object that will be described below. See sample code below:

VB.NET

Sample Code
objQFE.AddCustomAltDataButton(New CustomAltButton() With {
                                          .FieldName = "1own.H.Addr123",
                                          .Title = "Select your Home Address",
                                          .Groups = New List(Of CustomAltButtonGroup) From {
                                               New CustomAltButtonGroup() With {
                                                  .GroupLabel = "Account 1",
                                                  .Fields = New List(Of CustomAltButtonField) From {
                                                  New CustomAltButtonField() With {
                                                          .Name = "1own.H.Addr123",
                                                          .Value = "Rivadavia 2134"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Addr4",
                                                          .Value = "Rincon 20"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.City",
                                                          .Value = "CABA"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.State",
                                                          .Value = "BA"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Zip",
                                                          .Value = "1020"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Country",
                                                          .Value = "Argentina"
                                                      }
                                                  }
                                              },
                                               New CustomAltButtonGroup() With {
                                                  .GroupLabel = "Account 2",
                                                  .Fields = New List(Of CustomAltButtonField) From {
                                                  New CustomAltButtonField() With {
                                                          .Name = "1own.H.Addr123",
                                                          .Value = "3625 Del Amo Blvd"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Addr4",
                                                          .Value = ""
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.City",
                                                          .Value = "Torrance"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.State",
                                                          .Value = "CA"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Zip",
                                                          .Value = "90501"
                                                      },
                                                      New CustomAltButtonField() With {
                                                          .Name = "1own.H.Country",
                                                          .Value = "USA"
                                                      }
                                                  }
                                              }
                                          }
                                      })


C#

Sample Code
objQFE.AddCustomAltDataButton(new CustomAltButton {
	FieldName = "1own.H.Addr123",
	Title = "Select your Home Address",
	Groups = new List<CustomAltButtonGroup> {
		new CustomAltButtonGroup {
			GroupLabel = "Account 1",
			Fields = new List<CustomAltButtonField> {
				new CustomAltButtonField {
					Name = "1own.H.Addr123",
					Value = "Rivadavia 2134"
				},
				new CustomAltButtonField {
					Name = "1own.H.Addr4",
					Value = "Rincon 20"
				},
				new CustomAltButtonField {
					Name = "1own.H.City",
					Value = "CABA"
				},
				new CustomAltButtonField {
					Name = "1own.H.State",
					Value = "BA"
				},
				new CustomAltButtonField {
					Name = "1own.H.Zip",
					Value = "1020"
				},
				new CustomAltButtonField {
					Name = "1own.H.Country",
					Value = "Argentina"
				}
			}
		},
		new CustomAltButtonGroup {
			GroupLabel = "Account 2",
			Fields = new List<CustomAltButtonField> {
				new CustomAltButtonField {
					Name = "1own.H.Addr123",
					Value = "3625 Del Amo Blvd"
				},
				new CustomAltButtonField {
					Name = "1own.H.Addr4",
					Value = ""
				},
				new CustomAltButtonField {
					Name = "1own.H.City",
					Value = "Torrance"
				},
				new CustomAltButtonField {
					Name = "1own.H.State",
					Value = "CA"
				},
				new CustomAltButtonField {
					Name = "1own.H.Zip",
					Value = "90501"
				},
				new CustomAltButtonField {
					Name = "1own.H.Country",
					Value = "USA"
				}
			}
		}
	}
});

In the snippet above, we are setting a custom button that will show two records (Account 1 and Account 2). The user will see a popup after clicking the button with these two records in a drop down list. After selecting one record and clicking 'Add', the underlying fields will be populated accordingly.

For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK