Auto Populate - in more detail
Hi there,
We are busy building a database of collected company names that we want to use as leads for sales.
I have two forms;
New Names and
Leads. This is the simple version of the database:
New Names has the following fields:
-Company Name (Text)
-Contact Person (Text)
-Phone (Numerical)
Leads has the following fields:
-Company Name (Lookup)
-Contact Person (Text)
-Phone (Numerical)
-Comments (Long Text)
I want to select Company Name in the
Leads form and then have all the other fields in the
Leads form auto populate from the data in the
New Names form.
I have tried to play with the sample scripts here
Auto populate forms but I think I am getting the syntax wrong.
From what I understand, in the
Leads form, the Company Name field must be a
Lookup to the Company Name field in the form
New Names.
From there, I would open the
Leads form and then enter the workflow and select
Company_Name -> User Input and the code should be;
if (count(New_Names [ID == input.Company_Name]) >0)
{
temp = New_Names [ID == input.Company_Name];
input.Customer_Name = temp.Name;
input.Contact_Person = temp.Contact_Person;
etc.
etc.
etc.
}
However I keep getting an error on line 1 and the script stops there.
Am I using the correct syntax (commands, spaces etc.) and am I using ID in the correct context? (Could I maybe also ask if there is any reference material to study more on ID and how it works?)
I have also seen a different version of the code where the "count" wording is used at the rear of the phrase similar to
.count() so I do not know if that is a different coding all together...
Any help would be appreciated.