Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Salesforce 如何创建/更新潜在客户?_Salesforce_Apex - Fatal编程技术网

Salesforce 如何创建/更新潜在客户?

Salesforce 如何创建/更新潜在客户?,salesforce,apex,Salesforce,Apex,我是SFDC的新手。如何使用Apex创建/更新潜在客户 我试过了 @isTest private class TestClass { static testMethod void testLogic() { //Create new lead // insert new Lead(Company = 'Lead Company', FirstName = 'firstname', LastName = 'lastname', Email = 'some@g

我是SFDC的新手。如何使用Apex创建/更新潜在客户

我试过了

@isTest 
private class TestClass {
    static testMethod void testLogic() {
        //Create new lead
       // insert new Lead(Company = 'Lead Company', FirstName = 'firstname', LastName = 'lastname', Email = 'some@gmail.com');

    }
}

测试用例成功了,但我在点击Lead时在SFDC UI上看不到记录。请帮帮我

运行测试方法时,对数据库的所有写入也不会影响当前数据库,除非指定您无法读取当前数据库

在“执行匿名”中运行以下行将创建潜在客户:

   insert new Lead(Company = 'Lead Company', FirstName = 'firstname', LastName = 'lastname', Email = 'some@gmail.com');
或者只是创建一个常规类并从VF调用其方法