Create_Potentials_With_Account_And_Contacts 1.59 KB
Newer Older
Vikas's avatar
Vikas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<?xml version="1.0"?>
<api method="post">
    <create module="Potentials">
        <record>
            <field name="potentialname" value="@potentialname"></field>
            <field name="closingdate" value="@closingdate"></field>
            <field name="pipeline" value="Standard"></field>
            <field name="related_to" module="Accounts">
                <select>
                    <where>
                        <field name="accountname" value="@company"></field>
                    </where>
                </select>
                <create>
                    <record>
                        <field name="accountname" value="@company"></field>
                    </record>
                </create>
            </field>
            <field name="contact_id" module="Contacts">
                <select>
                    <where>
                        <field name="email" value="@email"></field>
                    </where>
                </select>
                <create>
                    <record>
                        <field name="lastname" value="@lastname"></field>
                        <field name="contacttype" value="Lead"></field>
                        <field name="account_id" module="Accounts">
                            <select>
                                <where>
                                    <field name="accountname" value="@company"></field>
                                </where>
                            </select>
                        </field>
                    </record>
                </create>
            </field>
        </record>
    </create>
</api>