Hi All,
Is there anyway(any client side API) to remove the lookup selection from the client side?
Thanks,
Ithrees
You may call the following client-side JS function:
rbf_removeObject(relatedFieldIntegrationName, relatedObjectId, relatedFieldIntegrationName);
Params:
relatedFieldIntegrationName: Integration name of the related Field.
relatedObjectId: Object ID of the current selection. In case of multiple selected value, call this method multiple times, once for each selection that you wish to remove.
Note: Yes, we do need to pass the relatedFieldIntegrationName as first & third argument. This minor issue is due to some recent revision & will be revised going forward.
Hi ithrees,
The client-side API rbf_setPicklistCode cannot set a picklist to blank as it does not have a picklist option code. However, you can use JavaScript to accomplish this. The code below sets the picklist value to blank on load of the page.
<script> $(function(){ setPicklistToBlank("Civil_Status"); }); function setPicklistToBlank(fieldName){ $("#" + fieldName + " option:selected").prop("selected", false); $("#" + fieldName + " option:first").prop("selected", "selected"); } </script>
Regards,
Godfrey
Hi Godfrey,
Thank you for your reply, This would help me if I'm using picklist as the selector but I am using lookup with pop up selector so there I need to remove the selection.
Regards,
Ithrees
You may call the following client-side JS function:
rbf_removeObject(relatedFieldIntegrationName, relatedObjectId, relatedFieldIntegrationName);
Params:
relatedFieldIntegrationName: Integration name of the related Field.
relatedObjectId: Object ID of the current selection. In case of multiple selected value, call this method multiple times, once for each selection that you wish to remove.
Note: Yes, we do need to pass the relatedFieldIntegrationName as first & third argument. This minor issue is due to some recent revision & will be revised going forward.
An example for the above proposed solution:
rbf_removeObject("R541167" ,541037, "R541167")
Thank you msiraj,
This is working fine as I wanted. Is there any way I can find these type JS functions that are not in the user guide?
Undocumented functions could be changed/deprecated across releases and their behavior is not guaranteed. You could use the suggested workaround for now but I highly recommend filing an idea about making this function public(documented) or a proper solution if there are other related cases that this function does not address.