Creating a function to populate another field

Creating a function to populate another field

Hi,

Working on a small inventory system here and running into bumps along the way. I am importing some 900 entries into this form and trying to populate a unique inventory number for each. The On Add > On Success or On Edit > On Success actions I've setup dont work for bulk edits or imports, so im thinking maybe its an idea to just have a button in the report that says 'Update Inventory Number' for those times that new records are imported which is hardly. But I dont want to go and manually update 900 entries.

I am trying to create a function in the report view that when selected, will grab data from a few fields :
First Name (First_Name)
Last Name (Last_Name)
Year (Year)
and then populate those values into a field called Inventory Number (Inv_Num1).

I attempted to create a custom function with this

  1. string InventoryNumber.UpdateInv(string Inv_Num1)
  2. {
  3.     FN = input.First_Name.subString(0,1);
  4.     LN = input.Last_Name.subString(0,1);
  5.     YR = input.Year.subString(2,4);
  6.     outputstr = FN + "/" + LN + "/" + YR;
  7.     return outputstr;
  8. }


That of course resulted in an error saying First_Name is not declared. Im extremely new to Deluge scripting so im not really clear how I have to declare those values. Any help is much appreciated