Empty field-values in validation rule function

Empty field-values in validation rule function

Hi !

I've written my first function in deluge script which acts as a validation rule of a field in crm leads.
The function works but some fields are without a value, I've double checked the value exists.

For example the system field entityMap.get("First_Name") does not return anything, or entityMap.get("Salutation") ... 

Other fields like Last_Name, Company, Email, Mailstatus are returning their correct record values.

The access settings for this field are also okay / the same like the other ones.

What can cause the problem? How to receive the fields' values?

Kind regards

  1. entityMap = crmAPIRequest.toMap().get("record");
  2. Last_Name = entityMap.get("Last_Name");
  3. First_Name = entityMap.get("First_Name");
  4. Company = entityMap.get("Company");
  5. Email = entityMap.get("Email");
  6. mailstatus = entityMap.get("Mailstatus");
  7. //mailstatus = "Newsletter neu";
  8. response = Map();
  9. if(mailstatus == "Newsletter neu")
  10. {
  11. mailstatus_outbound = invokeurl
  12. [
  13. url :"https://....de"
  14. type :PUT
  15. parameters:{'Modul':'Leads','action':'Mailstatus','Mailstatus':mailstatus,'Email':Email,'Last_Name':Last_Name,'First_Name':First_Name,'Company':Company}
  16. ];
  17. response.put('status','success');
  18. return response;
  19. }