0

I have a journey called Trade confirmation (Quoted). I built a custom object called Quoted. It has fields:

  • Account_Name__c
  • Channel__c
  • Created__c
  • Quote_Value__c
  • Trade_Confirmation__c
  • Trade_Confirmation_URL__c

Here is my AMPscript:

%%[

/*Lookup Quoted__c Object*/
set @quotedRows = RetrieveSalesforceObjects("Quoted__c:Id","Quoted__c:Trade_Confirmation_URL__c", "Id", "=", "Quoted__c:Id")
set @quotedRows = RetrieveSalesforceObjects("Quoted__c",)

if @quotedRowCount > 0 then
   set @tradeConfirmationURL = field(row(@quotedRows,1),"Quoted__c:Trade_Confirmation_URL__c")
 endif

]%%

Getting this error message:

The function call does not include the minimum number of parameters required for the function Function Call: RetrieveSalesforceObjects("Quoted__c",) Function Name: RetrieveSalesforceObjects Number of Required Parameters: 5 Number of Parameters in Call: 1

enter image description here

0

Looks like you've got a stray code fragment in there. Plus your lookup value needs to be a variable, not a literal string. I'd try something like this:

%%[

var @id, @row
set @id = AttributeValue("Quoted__c:Id")

set @quotedRows = RetrieveSalesforceObjects(
                    "Quoted__c"
                    , "Id, Trade_Confirmation_URL__c"
                    , "Id", "=", @id)

set @quotedRowCount = rowcount(@quotedRows)

if @quotedRowCount > 0 then

   set @row = row(@quotedRows,1)
   set @tradeConfirmationURL = field(@row,"Trade_Confirmation_URL__c")

endif

]%%
<br>tradeConfirmationURL: %%=v(@tradeConfirmationURL)=%%

Reference

| improve this answer | |
  • I got this error message . Call to retrieve records for salesforceobject Quoted__c:Id failed! Error in the application. API Fault: Salesforce.com Fault thrown. Exception Type:InvalidSObjectFault Exception Code:INVALID_TYPE Exception Message:sObject type 'Quoted__c:Id' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. At row:-1 and column: -1 – Andre Green May 31 '18 at 11:57
  • What if I am just trying to get the Quoted Object and just want to look at Trade_Confirmation_URL__C and Trade_Confirmation__c and nothing else. – Andre Green May 31 '18 at 12:00
  • The function call includes an invalid number of repeating parameters. Repeating parameters must be included in full sets. Function Call: RetrieveSalesforceObjects("Quoted__c:Id", "Quoted__c:Trade_Confirmation_URL__c","Quoted__c:Trade_Confirmation__c", "Quoted__c:Channel__c", "Id", "=", @id) Function Name: RetrieveSalesforceObjects Number of Parameters in Repeating Set: 3 Number of Repeating Parameters in Call: 5 Number of Invalid Repeating Parameters in Call: 2 – Andre Green May 31 '18 at 12:06
  • Ah, yes. Updated my example. Removed the object prefixes. – Adam Spriggs May 31 '18 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.