Load Method with different Field other than ID?

  • 7 December 2016
  • 2 replies
  • 0 views

Userlevel 3
Badge +16

Hi K2ers,

 

Anyone know the answer to this.

 

I have a Smartobject with 4 fields as follows:

ID, FirstName, Surname, RandomNumber (some of you will have read my teeth pulling adventure with generating random numbers)

 

These fields are mapped to a View on a Form.... Simple so far right?

 

I enter the data, SAVE it (Save Mathod) and then send a link to the User to open the record by using a View rule -> Send Email to User.

 

In the email body, i enter the path to the form and add /?Doculink= myrandomnumber on the end i.e. 23423523432423 (I don't want to use record ID, hence the random number)

 

I then go back to my form and add a Parameter called Doculink and setup my rules, add a rule to the form which says "if a form parameter is specified" i.e. /?Doculink the do a Load Method.

 

The problem is that in the Load Method, it only gives me the Input Mappings for ID, no other field is available to use as the input.

 

Is there a way of allowing me to use the RandomNumber field to open the record?

 

The bottom line is we don't want the customer to use the ID field in the Smartobject, we want to use the RandomNumber field

 

Thanks in advance guys

 

P.S. Is it because the Smartobject ID field is Key? If so, how do i change it, it is greyed out?

 

 

 


2 replies

Userlevel 3
Badge +8

Dear

 

Have you checked other available methods you could use for the smartobject ?

i do beleive what you are looking for is Get-list or List method ... you can use it and filter the result by the random number you got .

but i wouldn't recommend that , unless you could confirm that this random number will be a unique number in the table .

because if there is a chance for this number to be duplicate for 2 records , then when your form loads the data , it will always load data from last record .

get list method is provided there to use it for retrieving multiple records for lists , but its also could be used if you want to get 1 record by an input other than the ID , but my whole point is about guarantee that this random number is unique through the whole table , then feel free to use it .

 

Hint : if u want to guarantee it , just make sure you check your records on the save form , and make sure you don't duplicate random numbers .

 

Hope it helps!

Regards

Userlevel 3
Badge +16

Hey Ahmad,

 

Just wanted to say thanks (again) for your help with this man, got it working using your suggested Getlist Method

 

U left the input mappings blank, added my paremeter in the Filter section and then in output settings had the fields mapped.

 

Only problem i have now is that i get "Page not found" when trying to load the form via a link sent to the user via email.

The link works fine if opened from the server, just not from ourtside.

 

I've checked firewall issues etc, but they all fine... I might just post up another thread here.

 

Thanks

Reply