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
HarryBHarryB 

S-Control in Edit page layout?

Hi there,
 
I'm currently looking to find a way to enable a S-Control to be executed in an Edit page layout only.
The S-Control should be placed to the Edit screen of a child object of Opportunities and then pre-fill an input field with the data/content of an Opportunity field.
 
So far I am only able to place a S-Control in the Detail page layout, but it won't be shown/executed during Edit.
 
Is there any other way (except using a S-Control) to achieve this? If there is nothing, the only other way I could think of is to overwrite the field after Edit using an Outgoing Message. 
 
TIA for any hints or comments!
 
Cheers,
Harry
RickyGRickyG
Harry -

It's not entirely clear to me what you are trying to accomplish.  If you are simply copying the data from an Opportunity field, you can do this with Apex Code, if you are running UE.  But I would caution against simply copying values, since duplicate values can lead to data integrity problems.

If you aren't just duplicating a value, you can't use a workflow field update to retrieve data from a different object, so if you are updated a child object, you will have to create an S-Control to write to the field. Why not use a custom field and a button to initialize the value (via an S-Control)?  The user would have to explicitly click on the button, but you could add a validation rule to remind them to do it.

Hope this helps.

- Rick Greenwald
Developer Evangelist
HarryBHarryB
Rick,
 
no UE here - just normal companies ;-)
 
Let me try another approach:
A customer wants to have a default field value, when he adds or modifies a record of a custom object (child of Opportunities). This field value should be visible in the Edit page right away, so that the user either does not have to touch it or simply overwrites it with the new value.
 
No problem up to here - but this default field value is not fixed, but depending on the content of an Opportunity field.
 
Cheers,
Harry
RickyGRickyG
Harry -

The sticking points are that you want the default value changed whenever the value in the Opportunity record changes, and you want the change to show up in the Edit page right away. 

I think you could do this with a custom button, as I mentioned, or a trigger, which requires UE.  But I can't think of another workaround.  Perhaps others can chime in.

- Rick Greenwald
Developer Evangelist
HarryBHarryB

Rick,

thanks for your input. Maybe someone else has another idea.

This whole scenario has to work fully integrated/automated - so unfortunately a custom link/button is not a choice here. 

Cheers,

Harry

RickyGRickyG
Harry -

On further consideration, how about replacing the various Save buttons on the Opportunity record, to handle edits, and the New button for the related custom object, with s-controls?  A bit more work, and, of course, these UI-centric implementations will not operate if you are accessing the objects through the API. 

- Rick Greenwald
Developer Evangelist