Global API
...
Code Examples
Invokable Class for Flow
Flow (Meta)
1min
XML
1<?xml version="1.0" encoding="UTF-8"?>
2<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
3 <actionCalls>
4 <name>Create_NetSuite_Company</name>
5 <label>Create NetSuite Company</label>
6 <locationX>176</locationX>
7 <locationY>398</locationY>
8 <actionName>BW_CreateNetSuiteCompany_Invokable</actionName>
9 <actionType>apex</actionType>
10 <connector>
11 <targetReference>NetSuite_Result</targetReference>
12 </connector>
13 <flowTransactionModel>Automatic</flowTransactionModel>
14 <inputParameters>
15 <name>AccountNumber</name>
16 <value>
17 <elementReference>Get_Salesforce_Account.Id</elementReference>
18 </value>
19 </inputParameters>
20 <inputParameters>
21 <name>BillingCity</name>
22 <value>
23 <elementReference>Billing_Address.city</elementReference>
24 </value>
25 </inputParameters>
26 <inputParameters>
27 <name>BillingPostalCode</name>
28 <value>
29 <elementReference>Billing_Address.postalCode</elementReference>
30 </value>
31 </inputParameters>
32 <inputParameters>
33 <name>BillingState</name>
34 <value>
35 <elementReference>Billing_Address.province</elementReference>
36 </value>
37 </inputParameters>
38 <inputParameters>
39 <name>BillingStreet</name>
40 <value>
41 <elementReference>Billing_Address.street</elementReference>
42 </value>
43 </inputParameters>
44 <inputParameters>
45 <name>companyName</name>
46 <value>
47 <elementReference>Company_Name</elementReference>
48 </value>
49 </inputParameters>
50 <inputParameters>
51 <name>firstName</name>
52 <value>
53 <elementReference>Name.firstName</elementReference>
54 </value>
55 </inputParameters>
56 <inputParameters>
57 <name>lastName</name>
58 <value>
59 <elementReference>Name.lastName</elementReference>
60 </value>
61 </inputParameters>
62 <inputParameters>
63 <name>Phone</name>
64 <value>
65 <elementReference>Phone</elementReference>
66 </value>
67 </inputParameters>
68 <inputParameters>
69 <name>ShippingCity</name>
70 <value>
71 <elementReference>Shipping_Address.city</elementReference>
72 </value>
73 </inputParameters>
74 <inputParameters>
75 <name>ShippingPostalCode</name>
76 <value>
77 <elementReference>Shipping_Address.postalCode</elementReference>
78 </value>
79 </inputParameters>
80 <inputParameters>
81 <name>ShippingState</name>
82 <value>
83 <elementReference>Shipping_Address.province</elementReference>
84 </value>
85 </inputParameters>
86 <inputParameters>
87 <name>ShippingStreet</name>
88 <value>
89 <elementReference>Shipping_Address.street</elementReference>
90 </value>
91 </inputParameters>
92 <inputParameters>
93 <name>SubsidiaryId</name>
94 <value>
95 <stringValue>8</stringValue>
96 </value>
97 </inputParameters>
98 <inputParameters>
99 <name>taxNumber</name>
100 <value>
101 <elementReference>Tax_Number</elementReference>
102 </value>
103 </inputParameters>
104 <inputParameters>
105 <name>testMode</name>
106 <value>
107 <stringValue>sendtonetsuite</stringValue>
108 </value>
109 </inputParameters>
110 <inputParameters>
111 <name>Website</name>
112 <value>
113 <elementReference>Website</elementReference>
114 </value>
115 </inputParameters>
116 <outputParameters>
117 <assignToReference>companyInternalIdapex</assignToReference>
118 <name>companyInternalId</name>
119 </outputParameters>
120 <outputParameters>
121 <assignToReference>companyNameApex</assignToReference>
122 <name>companyName</name>
123 </outputParameters>
124 <outputParameters>
125 <assignToReference>firstNameApex</assignToReference>
126 <name>firstName</name>
127 </outputParameters>
128 <outputParameters>
129 <assignToReference>lastNameApex</assignToReference>
130 <name>lastName</name>
131 </outputParameters>
132 <outputParameters>
133 <assignToReference>netSuiteResponseapex</assignToReference>
134 <name>netSuiteResponse</name>
135 </outputParameters>
136 <outputParameters>
137 <assignToReference>testModeapex</assignToReference>
138 <name>testMode</name>
139 </outputParameters>
140 </actionCalls>
141 <apiVersion>53.0</apiVersion>
142 <choices>
143 <name>Customer</name>
144 <choiceText>Customer</choiceText>
145 <dataType>String</dataType>
146 </choices>
147 <choices>
148 <name>CUSTOMER_Closed_Won</name>
149 <choiceText>CUSTOMER-Closed Won</choiceText>
150 <dataType>String</dataType>
151 </choices>
152 <choices>
153 <name>PROSPECT_Proposal</name>
154 <choiceText><span style="background-color: rgb(255, 255, 255); color: rgb(62, 62, 60);">PROSPECT-Proposal</span></choiceText>
155 <dataType>String</dataType>
156 </choices>
157 <choices>
158 <name>Vendor</name>
159 <choiceText>Vendor</choiceText>
160 <dataType>String</dataType>
161 </choices>
162 <interviewLabel>Create NetSuite Company from Salesforce Account Invokable {!$Flow.CurrentDateTime}</interviewLabel>
163 <label>Create NetSuite Company from Salesforce Account Invokable</label>
164 <processMetadataValues>
165 <name>BuilderType</name>
166 <value>
167 <stringValue>LightningFlowBuilder</stringValue>
168 </value>
169 </processMetadataValues>
170 <processMetadataValues>
171 <name>CanvasMode</name>
172 <value>
173 <stringValue>AUTO_LAYOUT_CANVAS</stringValue>
174 </value>
175 </processMetadataValues>
176 <processMetadataValues>
177 <name>OriginBuilderType</name>
178 <value>
179 <stringValue>LightningFlowBuilder</stringValue>
180 </value>
181 </processMetadataValues>
182 <processType>Flow</processType>
183 <recordLookups>
184 <name>Get_Salesforce_Account</name>
185 <label>Get Salesforce Account</label>
186 <locationX>176</locationX>
187 <locationY>158</locationY>
188 <assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
189 <connector>
190 <targetReference>NS_Company_Create</targetReference>
191 </connector>
192 <filterLogic>and</filterLogic>
193 <filters>
194 <field>Id</field>
195 <operator>EqualTo</operator>
196 <value>
197 <elementReference>recordId</elementReference>
198 </value>
199 </filters>
200 <getFirstRecordOnly>true</getFirstRecordOnly>
201 <object>Account</object>
202 <storeOutputAutomatically>true</storeOutputAutomatically>
203 </recordLookups>
204 <screens>
205 <name>NetSuite_Result</name>
206 <label>NetSuite Result</label>
207 <locationX>176</locationX>
208 <locationY>518</locationY>
209 <allowBack>false</allowBack>
210 <allowFinish>true</allowFinish>
211 <allowPause>false</allowPause>
212 <fields>
213 <name>NetSuiteResponse</name>
214 <fieldText><p>Company Name: {!companyNameApex}</p><p>Mode: {!testModeapex}</p><p><span style="background-color: var(--lwc-colorBackgroundInput,rgb(255, 255, 255)); color: var(--lwc-colorTextWeak,rgb(62, 62, 60)); font-size: var(--lwc-fontSize3,0.8125rem); font-family: var(--lwc-fontFamily,-apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;);">NetSuite InternalID: {!companyInternalIdapex}</span></p><p><span style="background-color: var(--lwc-colorBackgroundInput,rgb(255, 255, 255)); color: var(--lwc-colorTextWeak,rgb(62, 62, 60)); font-size: var(--lwc-fontSize3,0.8125rem); font-family: var(--lwc-fontFamily,-apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;);">NetSuite Response: {!netSuiteResponseapex}</span></p></fieldText>
215 <fieldType>DisplayText</fieldType>
216 </fields>
217 <showFooter>true</showFooter>
218 <showHeader>true</showHeader>
219 </screens>
220 <screens>
221 <name>NS_Company_Create</name>
222 <label>Create NetSuite Company from Salesforce Account</label>
223 <locationX>176</locationX>
224 <locationY>278</locationY>
225 <allowBack>false</allowBack>
226 <allowFinish>true</allowFinish>
227 <allowPause>false</allowPause>
228 <connector>
229 <targetReference>Create_NetSuite_Company</targetReference>
230 </connector>
231 <fields>
232 <name>Name</name>
233 <extensionName>flowruntime:name</extensionName>
234 <fieldType>ComponentInstance</fieldType>
235 <inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
236 <isRequired>true</isRequired>
237 <storeOutputAutomatically>true</storeOutputAutomatically>
238 </fields>
239 <fields>
240 <name>Company_Name</name>
241 <dataType>String</dataType>
242 <defaultValue>
243 <elementReference>Get_Salesforce_Account.Name</elementReference>
244 </defaultValue>
245 <fieldText>Company Name</fieldText>
246 <fieldType>InputField</fieldType>
247 <isRequired>false</isRequired>
248 </fields>
249 <fields>
250 <name>Parent_Company</name>
251 <dataType>String</dataType>
252 <defaultValue>
253 <elementReference>Get_Salesforce_Account.Parent.Name</elementReference>
254 </defaultValue>
255 <fieldText>Parent Company</fieldText>
256 <fieldType>InputField</fieldType>
257 <isRequired>false</isRequired>
258 </fields>
259 <fields>
260 <name>Entity_Type</name>
261 <choiceReferences>Customer</choiceReferences>
262 <choiceReferences>Vendor</choiceReferences>
263 <dataType>String</dataType>
264 <defaultSelectedChoiceReference>Customer</defaultSelectedChoiceReference>
265 <fieldText>Company Type</fieldText>
266 <fieldType>RadioButtons</fieldType>
267 <isRequired>false</isRequired>
268 </fields>
269 <fields>
270 <name>Status</name>
271 <choiceReferences>CUSTOMER_Closed_Won</choiceReferences>
272 <choiceReferences>PROSPECT_Proposal</choiceReferences>
273 <dataType>String</dataType>
274 <defaultSelectedChoiceReference>CUSTOMER_Closed_Won</defaultSelectedChoiceReference>
275 <fieldText>Status</fieldText>
276 <fieldType>DropdownBox</fieldType>
277 <isRequired>false</isRequired>
278 </fields>
279 <fields>
280 <name>Email</name>
281 <dataType>String</dataType>
282 <fieldText>Email</fieldText>
283 <fieldType>InputField</fieldType>
284 <isRequired>false</isRequired>
285 </fields>
286 <fields>
287 <name>Phone</name>
288 <dataType>String</dataType>
289 <defaultValue>
290 <elementReference>Get_Salesforce_Account.Phone</elementReference>
291 </defaultValue>
292 <fieldText>Phone</fieldText>
293 <fieldType>InputField</fieldType>
294 <isRequired>false</isRequired>
295 </fields>
296 <fields>
297 <name>Billing_Address</name>
298 <extensionName>flowruntime:address</extensionName>
299 <fieldType>ComponentInstance</fieldType>
300 <inputParameters>
301 <name>city</name>
302 <value>
303 <elementReference>Get_Salesforce_Account.BillingCity</elementReference>
304 </value>
305 </inputParameters>
306 <inputParameters>
307 <name>country</name>
308 <value>
309 <elementReference>Get_Salesforce_Account.BillingCountry</elementReference>
310 </value>
311 </inputParameters>
312 <inputParameters>
313 <name>addressLabel</name>
314 <value>
315 <stringValue>Billing Address</stringValue>
316 </value>
317 </inputParameters>
318 <inputParameters>
319 <name>postalCode</name>
320 <value>
321 <elementReference>Get_Salesforce_Account.BillingPostalCode</elementReference>
322 </value>
323 </inputParameters>
324 <inputParameters>
325 <name>province</name>
326 <value>
327 <elementReference>Get_Salesforce_Account.BillingState</elementReference>
328 </value>
329 </inputParameters>
330 <inputParameters>
331 <name>street</name>
332 <value>
333 <elementReference>Get_Salesforce_Account.BillingStreet</elementReference>
334 </value>
335 </inputParameters>
336 <inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
337 <isRequired>true</isRequired>
338 <storeOutputAutomatically>true</storeOutputAutomatically>
339 </fields>
340 <fields>
341 <name>Shipping_Address</name>
342 <extensionName>flowruntime:address</extensionName>
343 <fieldType>ComponentInstance</fieldType>
344 <inputParameters>
345 <name>addressLabel</name>
346 <value>
347 <stringValue>Shipping Address</stringValue>
348 </value>
349 </inputParameters>
350 <inputParameters>
351 <name>city</name>
352 <value>
353 <elementReference>Get_Salesforce_Account.ShippingCity</elementReference>
354 </value>
355 </inputParameters>
356 <inputParameters>
357 <name>country</name>
358 <value>
359 <elementReference>Get_Salesforce_Account.ShippingCountry</elementReference>
360 </value>
361 </inputParameters>
362 <inputParameters>
363 <name>postalCode</name>
364 <value>
365 <elementReference>Get_Salesforce_Account.ShippingPostalCode</elementReference>
366 </value>
367 </inputParameters>
368 <inputParameters>
369 <name>province</name>
370 <value>
371 <elementReference>Get_Salesforce_Account.ShippingState</elementReference>
372 </value>
373 </inputParameters>
374 <inputParameters>
375 <name>street</name>
376 <value>
377 <elementReference>Get_Salesforce_Account.ShippingStreet</elementReference>
378 </value>
379 </inputParameters>
380 <inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
381 <isRequired>true</isRequired>
382 <storeOutputAutomatically>true</storeOutputAutomatically>
383 </fields>
384 <fields>
385 <name>Tax_Number</name>
386 <dataType>String</dataType>
387 <defaultValue>
388 <elementReference>Get_Salesforce_Account.Tax_Number__c</elementReference>
389 </defaultValue>
390 <fieldText>Tax Number</fieldText>
391 <fieldType>InputField</fieldType>
392 <isRequired>false</isRequired>
393 </fields>
394 <fields>
395 <name>Website</name>
396 <dataType>String</dataType>
397 <defaultValue>
398 <elementReference>Get_Salesforce_Account.Website</elementReference>
399 </defaultValue>
400 <fieldText>Website</fieldText>
401 <fieldType>InputField</fieldType>
402 <isRequired>false</isRequired>
403 </fields>
404 <nextOrFinishButtonLabel>Create Company in NetSuite</nextOrFinishButtonLabel>
405 <showFooter>true</showFooter>
406 <showHeader>true</showHeader>
407 </screens>
408 <start>
409 <locationX>50</locationX>
410 <locationY>0</locationY>
411 <connector>
412 <targetReference>Get_Salesforce_Account</targetReference>
413 </connector>
414 </start>
415 <status>Active</status>
416 <variables>
417 <name>companyInternalIdapex</name>
418 <dataType>String</dataType>
419 <isCollection>false</isCollection>
420 <isInput>true</isInput>
421 <isOutput>true</isOutput>
422 </variables>
423 <variables>
424 <name>companyNameApex</name>
425 <dataType>String</dataType>
426 <isCollection>false</isCollection>
427 <isInput>true</isInput>
428 <isOutput>true</isOutput>
429 </variables>
430 <variables>
431 <name>firstNameApex</name>
432 <dataType>String</dataType>
433 <isCollection>false</isCollection>
434 <isInput>true</isInput>
435 <isOutput>true</isOutput>
436 </variables>
437 <variables>
438 <name>lastNameApex</name>
439 <dataType>String</dataType>
440 <isCollection>false</isCollection>
441 <isInput>true</isInput>
442 <isOutput>true</isOutput>
443 </variables>
444 <variables>
445 <name>netSuiteResponseapex</name>
446 <dataType>String</dataType>
447 <isCollection>false</isCollection>
448 <isInput>true</isInput>
449 <isOutput>true</isOutput>
450 </variables>
451 <variables>
452 <description>Salesforce Account Id</description>
453 <name>recordId</name>
454 <dataType>String</dataType>
455 <isCollection>false</isCollection>
456 <isInput>true</isInput>
457 <isOutput>false</isOutput>
458 <value>
459 <elementReference>$Flow.CurrentRecord</elementReference>
460 </value>
461 </variables>
462 <variables>
463 <name>testModeapex</name>
464 <dataType>String</dataType>
465 <isCollection>false</isCollection>
466 <isInput>true</isInput>
467 <isOutput>true</isOutput>
468 </variables>
469</Flow>
470
471
Updated 14 Jun 2024
Did this page help you?