0

This is my code. I have to set the default value for Account fields like Name ,Phone etc...but it shows some error.

trigger setDefaultAccountValues on Account (before  insert, before update){


    for (Account acc : trigger.new){
        acc.Name ='xxx';
    }
}

The error is:

Error: Compile Error: Variable is not visible: name at line 5 column 9

How to resolve this?

4

1 回答 1

0

我假设这是 Apex,因此请查看本教程:如何在 Apex 中编写触发器

[更新]

很可能您需要将public(or global)访问修饰符添加到类中的Name(or name,因为 Apex 不区分大小写) 变量Account

于 2013-05-02T08:29:40.423 回答