I'm encountering the following error when I'm trying to publish landing page:
Error Message: "Call to create the salesforceobject Account failed! Error status code: REQUIRED_FIELD_MISSING Error message: Required fields are missing: [LastName]"
I'm attempting to create a person account. The error only occurs when I pass the last name parameter. However, when I hardcode the last name, the record saves successfully, and the landing page creates the account as intended.
AmpScript with Error:
%%[set @email = RequestParameter("email")set @fname = RequestParameter("firstName")set @lName = RequestParameter("lastName")set @phone = RequestParameter("mobilephone")set @Leadid = RequestParameter("Leadid")/*Inserting Account record in Salesforce */set @RecordTypeId = "0122v000000jtfc"var @accidset @accid=CreateSalesforceObject("Account", 5,"LastName",@lName,"FirstName",@fname,"PersonMobilePhone",@phone,"PersonEmail",@email,"RecordTypeId", @RecordTypeId)]%%
This works perfectly:
set @accid=CreateSalesforceObject("Account", 5,"LastName","Test Last Name","FirstName",@fname,"PersonMobilePhone",@phone,"PersonEmail",@email,"RecordTypeId", @RecordTypeId)