@@ -620,6 +620,78 @@ async function getFormElementOptionsSetOptions(
620620 }
621621 }
622622 }
623+ case 'SALESFORCE_PICKLIST' : {
624+ const formElementOptionSetEnvironmentSalesforcePicklist =
625+ formElementOptionsSet . environments . find (
626+ ( environment ) =>
627+ environment . formsAppEnvironmentId === formsAppEnvironmentId ,
628+ )
629+ if ( ! formElementOptionSetEnvironmentSalesforcePicklist ) {
630+ return {
631+ type : 'ERROR' ,
632+ error : new OneBlinkAppsError (
633+ `Dynamic list configuration has not been completed yet. Please contact your administrator to rectify the issue.` ,
634+ {
635+ title : 'Misconfigured Dynamic List' ,
636+ originalError : new Error (
637+ JSON . stringify (
638+ {
639+ formElementOptionsSetId : formElementOptionsSet . id ,
640+ formElementOptionsSetName : formElementOptionsSet . name ,
641+ formsAppEnvironmentId,
642+ } ,
643+ null ,
644+ 2 ,
645+ ) ,
646+ ) ,
647+ } ,
648+ ) ,
649+ }
650+ }
651+
652+ try {
653+ const { options } = await getRequest < { options : unknown } > (
654+ `${ tenants . current . apiOrigin } /forms/${ formId } /salesforce-picklist-options?formElementOptionsSetId=${ formElementOptionsSet . id } ` ,
655+ abortSignal ,
656+ )
657+ return {
658+ type : 'OPTIONS' ,
659+ options,
660+ }
661+ } catch ( error ) {
662+ Sentry . captureException ( error )
663+ return {
664+ type : 'ERROR' ,
665+ error : new OneBlinkAppsError (
666+ `Options could not be loaded. Please contact your administrator to rectify the issue.` ,
667+ {
668+ title : 'Invalid List Response' ,
669+ httpStatusCode : ( error as HTTPError ) . status ,
670+ originalError : new OneBlinkAppsError (
671+ JSON . stringify (
672+ {
673+ formsAppEnvironmentId,
674+ formElementOptionsSetId : formElementOptionsSet . id ,
675+ formElementOptionsSetName : formElementOptionsSet . name ,
676+ salesforceObject :
677+ formElementOptionSetEnvironmentSalesforcePicklist . object
678+ . label ,
679+ salesforceField :
680+ formElementOptionSetEnvironmentSalesforcePicklist . field
681+ . label ,
682+ } ,
683+ null ,
684+ 2 ,
685+ ) ,
686+ {
687+ originalError : error as HTTPError ,
688+ } ,
689+ ) ,
690+ } ,
691+ ) ,
692+ }
693+ }
694+ }
623695 case 'GOOD_TO_GO_CUSTOM_FIELD' : {
624696 const formElementOptionSetEnvironmentGoodToGoCustomField =
625697 formElementOptionsSet . environments . find (
0 commit comments