function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
InfopiaInfopia 

Lookup Values on Web-to-Case?

Does anyone know how to get Web-to-Case to work with a lookup field?


Thanks,

Jon

werewolfwerewolf
No, web to case can't work with a lookup field.  This is because lookup fields have to be filled with data, but as an unauthenticated user a Web To Case user can't see any data (among other things).

The only lookup fields that will work with W2C are Contact and Account, and then only implicitly -- W2C will try to fill them automatically by looking for a match on the submitted email address.
InfopiaInfopia
Ok, thanks.  What do you think about taking the value as a text field and then using a trigger to query and update the the Lookup value?

Thanks,
Jon
werewolfwerewolf
That's fine, just don't change your lookup values too often (or make sure you keep the values on your W2C page in sync).
Ryan ThomasRyan Thomas

There have been some advancements (Communities) to Salesforce since this post, but this is possible with certain standard objects. 
When you create a community, you can create a Site Guest User specific to that community. That user will not be in the same list as regular users.

All Communities > Builder >  'Upper left icon' > Administation > Pages >  Advanced Customizations/Go to Force.com >  Public Access Settings

At the same time, you should create a Public Group for the Guest User to join. You can then share internal data (Sharing Settings) with the public group and expose the lookup field data. You can even put a filter on the data you expose. 

Then you create a Global Action for your community where you determine predefined field values and a page layout for the community.  In that layout, the lookup field you created can be included. 

The Trailblazer/Success pages in Salesforce can give you more detail, but it can now be done.