title: Get userID and save it in function - Solidity Beginner
body: <p>This is my first <strong>Solidity</strong> project.</p>
  <p>I'm trying to create a kind of supply chain, more than anything just practice code.</p>
  <p>I came across a problem that I couldn't solve or find the solution online.</p>
  <p>Problem: I want to get the user ID and save it in each <code>function</code> so it would look like...</p>
  <pre><code>function Customer() public {
         checked = Process.Received;
         status = Process.NotPaid;
         //userid = Process.&lt; THE ID &gt;
       }
  </code></pre>
  <p>I tried with this ...</p>
  <pre><code>function getStruct() public
       view
       returns (string, uint)
       {
           return (User);
  
       }
  </code></pre>
  <p>But keeps on asking me to have the data located in <code>memory</code>. Which I tried but won't work for me.</p>
  <p>Full code:</p>
  <pre><code>pragma solidity ^0.5.1;
  
  contract SupplyChain {
  
    enum Process {
      Unknown,
      Checked,
      Received,
      Paid,
      NotPaid
    }
  
       Process public status;
       Process public checked;
       Process public userid;
  
  
       address user;
  
       struct User {
         uint  _id;
         string  _firstName;
         string  _lastName;
       }
  
  
       constructor() public {
         status = Process.Unknown;
         user = tx.origin;
       }
  
  
  
  
       function addUser(
         uint256 id,
         string memory _firstName,
         string memory _lastName
       ) public{
  
       }
  // NOT FINISHED NEED TO RETURN USER ID TO PRINT IN TRACKERS.
       function getStruct() public
       view
       returns (string, uint)
       {
           return (User);
  
       }
  
       function Factory() public {
         checked = Process.Checked;
         status = Process.NotPaid;
         // print userid
       }
       function TransportOne() public {
         checked = Process.Checked;
         status = Process.NotPaid;
         // print userid
       }
       function Deposit() public {
         checked = Process.Checked;
         status = Process.NotPaid;
         // print userid
       }
       function TransportTwo() public {
         checked = Process.Checked;
         status = Process.NotPaid;
         // print userid
       }
       function Customer() public {
         checked = Process.Received;
         status = Process.NotPaid;
         // print userid
       }
  
  }
  </code></pre>