Set end of MyAcctList to row value of "Name" Row value of "Name" - get the Name field value Set res to query session soql "select id, name from account where name like '" & startsWith & "%'" Set startsWith to text returned of (display dialog "Search Accounts" default answer "Enter Partial Account Name") this part will look up an account by searching the first few letters of the account name: Get name of FieldDescribe 4 of SObjectDescribe id "od_9522" of UserSession id "us_9519"īut I can't figure out the correct syntax to add a Contact Role to the new Contact in the Account/Contact creation script Get name of SObjectDescribe id "od_9522" of UserSession id "us_9519" Name of fourth FieldDescribe in crole - whose name is equal to "OwnerId" name of every FieldDescribe in opp - whose name is equal to "OwnerId" name of every FieldDescribe in cont - whose name is equal to "OwnerId" name of every FieldDescribe in acc - whose name is equal to "OwnerId" Set crole to second SObjectDescribe in session whose name contains "Account" set opp to first SObjectDescribe in session whose name is equal to "Opportunity" set cont to first SObjectDescribe in session whose name is equal to "Contact" set acc to first SObjectDescribe in session whose name is equal to "Account" I'm using the SFFieldDescribes and FieldDescribe snippets to determine the names/positions of these fields. The commented lines near the end are my feeble attempt at adding a Contact Role to this fresh new contact. Set ContactID to Id of first item of res2 cont setfield fourth FieldDescribe "Role" of second SObjectDescribe in session whose name contains "Account" of Accountid to "Decision Maker" cont setField named RoleField to "Decision Maker" set RoleField to name of fourth FieldDescribe in crole - to "Decision Maker" this is for the New Related Primary ContactĬont setField named "LastName" to "Smith" as textĬont setField named "FirstName" to "Jonesy" as textĬont setField named "AccountId" to AccountIDĬont setField named "PDS_Primary_Contact_c" with toĬont setField named "Email" to crole to second SObjectDescribe in session whose name contains AccountID Set session to login with saved credentialsĪcc setField named "Name" to "My New Account 17"Īcc setField named "PDS_QB_Billing_Address_c" to "Acct NameĪcc setField named "Phone" to "(222) 444-6666" Progress! Using the applescript snippets on, I got this to reliably create a New Account and Related Contact via applescript: I guess I don't know enough about Apex and the SF system yet to read what needs to be in the script.Īny insight as to how to add Accounts/Contacts/Opportunities at the same time would be greatly appreciated. I've spent the last couple of hours scouring the net and the script library trying to find out how to use something similar, or to add to it, so that I can create an Opportunity and Contact by adding some instructions to this. Set mySession to login username password "passwordtokenhere"Īcc setField named "Name" to "3 New Test Account"Īcc setField named "PDS_QB_Billing_Address_c" to "3 New Test AccountĪcc setField named "Phone" to "(888) 555-6666"Īnd It works like a champ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |