Announcement

Collapse
No announcement yet.

How to test the "name" field in an entity which has First Name and Last Name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to test the "name" field in an entity which has First Name and Last Name

    Hi,

    I am facing one problem when i use the formula. I have an entity of the type Person which has the First Name and Last Name. In the formula for the entity when i test "name" field it does not seem to work.

    How do i test the name of the person without having to test First Name and Last Name separately?

  • #2
    I don't think it possible since the Name need to be saved first before it get generated.

    (Only Theory here): I suppose you can do multi stage by (1) forcefully generate the name by doing a concatenation, or (2) instead of testing by name, test by First Name & Last Name

    Comment


    • #3
      espcrm

      Unfortunate the case is not as you have assumed. The field is from another entity which has already been created. The following is the formula in the Policyplan entity trying get the id key field for the entity called Policyholder which already has the field name created in the records:

      PHP Code:
      ifThen(ppnPolicyholdername != NULL,
               
      policyholderId record\findOne('Policyholder''name''desc',
                    
      'name='string\trim(ppnPolicyholdername));
      );
      ​ 

      Comment


      • #4
        This works:

        Code:
        $id = record\findOne('Person', null, null, 'name=', 'John Smith');​

        Comment


        • murugappan
          murugappan commented
          Editing a comment
          Hi yuri thank you for the update. I will try it. We have decided to use the base-plus type instead of the Person type. Most of the info supplied to us does not come in proper format. We found using the base-plus much easier. However I will try your advise separately .
      Working...
      X