某些领域的SOQL向上打bur

问题描述

v48

尝试制作从“任务”到“联系”再到“帐户”的向上查询,并遇到麻烦。

public class Editactivity extends AppCompatActivity {


Button submitBtn;
EditText et;
EditText ea;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit);

    submitBtn = findViewById(R.id.submitBtn);
    et = findViewById(R.id.editTitle);
    ea = findViewById(R.id.editArtist);

    submitBtn.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view)
        {
            // I do not kNow how to pass the values in the constructor
            Song newSong = new Song();
            Intent intent = new Intent(Editactivity.this,FavoriteActivity.class);
            newSong.setArtist(ea.getText().toString());
            newSong.setTitle(et.getText().toString());
            startActivity(intent);
            finish();

        }
    });



}
}

效果不错,但

Configuring remote state backend...
Initializing terraform configuration...

Warning: Value for undeclared variable

The root module does not declare a variable named "tag_user_name" but a value
was found in file "/terraform/terraform.tfvars". To use this value,add a
"variable" block to the configuration.

Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization,use TF_VAR_...
environment variables to set these instead.


Error: No value for required variable

  on variables.tf line 6:
   6: variable "aws_access_key_id" {

The root module input variable "aws_access_key_id" is not set,and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.


Error: No value for required variable

  on variables.tf line 10:
  10: variable "aws_secret_access_key" {

The root module input variable "aws_secret_access_key" is not set,and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.

不喜欢Last_Contact_Made__c,它是Contact上的一个字段。为什么会这样?要使其正常工作,我必须更改什么?

TIA,

Steve-learning Steve

解决方法

您基本上遇到polymorphic field的问题。

SOQL应该是这样的:

SELECT
    Id,Email_Direction__c,Who.Id,Owner.UserRoleId,TYPEOF Who
        WHEN Account THEN
            Last_Contact_Made__c
FROM
    Task
WHERE
    Who.Type = 'Contact'