END_OF_PAGE in ALV Object model
Dear all,
I am using ALV Object model, but the END_OF_PAGE is not triggering. I have pasted the sample code below. Let me know how to get END_OF_PAGE in ALV OM.
REPORT ztest_rr.
DATA : it_sflight TYPE TABLE OF sflight.
DATA : gr_sflight TYPE REF TO cl_salv_table,
gr_content TYPE REF TO cl_salv_form_element,
gr_sorts TYPE REF TO cl_salv_sorts,
gr_events TYPE REF TO cl_salv_events,
gr_print TYPE REF TO cl_salv_print.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_top_of_page FOR EVENT
top_of_page OF cl_salv_events
IMPORTING
page
table_index
r_top_of_page,
handle_end_of_page FOR EVENT
end_of_page OF cl_salv_events
IMPORTING
page
r_end_of_page.
ENDCLASS. "lcl_eventhandler DEFINITION
DATA : gr_handler TYPE REF TO lcl_eventhandler.
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_top_of_page.
PERFORM create_alv_form_content_top
USING page
table_index
CHANGING gr_content.
r_top_of_page->set_content( gr_content ).
ENDMETHOD. "handle_top_of_page
METHOD handle_end_of_page.
PERFORM create_alv_form_content_eop
USING page
CHANGING gr_content.
r_end_of_page->set_content( gr_content ).
ENDMETHOD. "handle_end_of_page
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT *
FROM sflight
INTO TABLE it_sflight.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>true
r_container =
container_name =
IMPORTING
r_salv_table = gr_sflight
CHANGING
t_table = it_sflight
CATCH cx_salv_msg .
ENDTRY.
CALL METHOD gr_sflight->get_sorts
RECEIVING
value = gr_sorts.
CALL METHOD gr_sorts->set_group_active
EXPORTING
value = if_salv_c_bool_sap=>true.
TRY.
CALL METHOD gr_sorts->add_sort
EXPORTING
columnname = 'CARRID'
position =
sequence = IF_SALV_C_SORT=>SORT_UP
subtotal = IF_SALV_C_BOOL_SAP=>FALSE
group = if_salv_c_sort=>group_with_newpage
obligatory = IF_SALV_C_BOOL_SAP=>FALSE
receiving
value =
CATCH cx_salv_not_found .
CATCH cx_salv_existing .
CATCH cx_salv_data_error .
ENDTRY.
CALL METHOD gr_sflight->get_event
RECEIVING
value = gr_events.
CALL METHOD gr_sflight->get_print
RECEIVING
value = gr_print.
CALL METHOD gr_print->set_reserve_lines
EXPORTING
value = 5.
CREATE OBJECT gr_handler.
SET HANDLER gr_handler->handle_top_of_page FOR gr_events.
SET HANDLER gr_handler->handle_end_of_page FOR gr_events.
CALL METHOD gr_sflight->display
*& Form CREATE_ALV_FORM_CONTENT_TOP
text
-->P_PAGE text
-->P_TABLE_INDEX text
<--P_GR_CONTENT text
FORM create_alv_form_content_top USING l_page
l_table_index
CHANGING lr_content.
WRITE 'HAI'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_TOP
*& Form CREATE_ALV_FORM_CONTENT_EOP
text
-->P_PAGE text
<--P_GR_CONTENT text
FORM create_alv_form_content_eop USING l_page
CHANGING lr_content.
WRITE 'BYE'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_EOP
Dear all,
I am using ALV Object model, but the END_OF_PAGE is not triggering. I have pasted the sample code below. Let me know how to get END_OF_PAGE in ALV OM.
REPORT ztest_rr.
DATA : it_sflight TYPE TABLE OF sflight.
DATA : gr_sflight TYPE REF TO cl_salv_table,
gr_content TYPE REF TO cl_salv_form_element,
gr_sorts TYPE REF TO cl_salv_sorts,
gr_events TYPE REF TO cl_salv_events,
gr_print TYPE REF TO cl_salv_print.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_top_of_page FOR EVENT
top_of_page OF cl_salv_events
IMPORTING
page
table_index
r_top_of_page,
handle_end_of_page FOR EVENT
end_of_page OF cl_salv_events
IMPORTING
page
r_end_of_page.
ENDCLASS. "lcl_eventhandler DEFINITION
DATA : gr_handler TYPE REF TO lcl_eventhandler.
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_top_of_page.
PERFORM create_alv_form_content_top
USING page
table_index
CHANGING gr_content.
r_top_of_page->set_content( gr_content ).
ENDMETHOD. "handle_top_of_page
METHOD handle_end_of_page.
PERFORM create_alv_form_content_eop
USING page
CHANGING gr_content.
r_end_of_page->set_content( gr_content ).
ENDMETHOD. "handle_end_of_page
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT *
FROM sflight
INTO TABLE it_sflight.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>true
r_container =
container_name =
IMPORTING
r_salv_table = gr_sflight
CHANGING
t_table = it_sflight
CATCH cx_salv_msg .
ENDTRY.
CALL METHOD gr_sflight->get_sorts
RECEIVING
value = gr_sorts.
CALL METHOD gr_sorts->set_group_active
EXPORTING
value = if_salv_c_bool_sap=>true.
TRY.
CALL METHOD gr_sorts->add_sort
EXPORTING
columnname = 'CARRID'
position =
sequence = IF_SALV_C_SORT=>SORT_UP
subtotal = IF_SALV_C_BOOL_SAP=>FALSE
group = if_salv_c_sort=>group_with_newpage
obligatory = IF_SALV_C_BOOL_SAP=>FALSE
receiving
value =
CATCH cx_salv_not_found .
CATCH cx_salv_existing .
CATCH cx_salv_data_error .
ENDTRY.
CALL METHOD gr_sflight->get_event
RECEIVING
value = gr_events.
CALL METHOD gr_sflight->get_print
RECEIVING
value = gr_print.
CALL METHOD gr_print->set_reserve_lines
EXPORTING
value = 5.
CREATE OBJECT gr_handler.
SET HANDLER gr_handler->handle_top_of_page FOR gr_events.
SET HANDLER gr_handler->handle_end_of_page FOR gr_events.
CALL METHOD gr_sflight->display
*& Form CREATE_ALV_FORM_CONTENT_TOP
text
-->P_PAGE text
-->P_TABLE_INDEX text
<--P_GR_CONTENT text
FORM create_alv_form_content_top USING l_page
l_table_index
CHANGING lr_content.
WRITE 'HAI'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_TOP
*& Form CREATE_ALV_FORM_CONTENT_EOP
text
-->P_PAGE text
<--P_GR_CONTENT text
FORM create_alv_form_content_eop USING l_page
CHANGING lr_content.
WRITE 'BYE'.
ENDFORM. " CREATE_ALV_FORM_CONTENT_EOP
Similar Messages
-
Editable field in ALV Object Model
Hi Guys,
I'm using method cl_salv_table=>factory to display an ALV (Object Model) in my report.
I want to "open up" one field for user entries, in other words make one column of my table editable.
I assumed to find the respective methods in class cl_salv_table, cl_salv_columns_table or cl_salv_display_settings, so far without getting anywhere.
I know about the field-catalogue and the method set_ready_for_input in class CL_GUI_ALV_GRID - it's not working once you're in the object model.
Any ideas how to do that?
Thank you!
With best regards,
AndreasHi Guys,
I'm using method cl_salv_table=>factory to display an ALV (Object Model) in my report.
I want to "open up" one field for user entries, in other words make one column of my table editable.
I assumed to find the respective methods in class cl_salv_table, cl_salv_columns_table or cl_salv_display_settings, so far without getting anywhere.
I know about the field-catalogue and the method set_ready_for_input in class CL_GUI_ALV_GRID - it's not working once you're in the object model.
Any ideas how to do that?
Thank you!
With best regards,
Andreas -
ALV object model - List download
H Experts,
I have used ALV object model to list display.
Also i have used class CL_ALV_COLUMNS_TABLE and its method set_long_text to set the column heading.
Now if i execute this report, long text is displayed properly in column heading.
But when i download this report output in spreadsheet, short text is displayed in column heading which is taken from the data element in DDIC.
Example:
I have declaed a column of type ABWTG.
I have set leng text as 'TEST'.
When i execute the report, column heading is displayed "TEST', which is as expected.
But when i download this report in spreadsheet, column heading is displayed as 'NUMBER' in spread sheet. While downloading column heading is taken from the data element for field ABWTG. But i want the long text 'TEST' to be displayed when the report output is downloaded.
Please suggest how to do it.
RegardsHi,
As per my understanding , it is displaying in excel based on ur ddic_output_length field.
only becoz of that field it will show the same header.
IF u will change the value at run time for this field then u will not get that issue,
I m also searching on the same issue.
Thanks
Rahul -
Hi,
Does anyone know how to create a context menu (right click on line or field) in the new ALV object model (class CL_SALV_TABLE)?
Thanks in advance
Keld Gregersen
PS: In the past we could use event CONTEXT_MENU_REQUEST in class CL_GUI_ALV_GRID, so it must be possibleI don't think there's "any such animal" in the new class. I'm not 100% certain however but the new class is only useful for fairly simple display only type grids.
There's no edit capability either.
I'd stick with cl_gui_alv_grid until there's some decent extra functionality in the cl_salv_table class.
It's fine for quick "bog standard" displays as it doesn't need a field catalog or any screens to be created by the user or developer - but you pay a price for that in limited fnctionality.
Cheers
jimbo -
Questions about ALV object model
Hi,
for a new report i´m planing to use the "new" ALV object model to create the ALV list. Now I´ve got two questions concerning this topic:
- is it possible to switch the ALV into the edit mode like it´s possible if the "old" CL_GUI_ALV_GRID class
is used?
- how I can encolor specific cells?
I couldn´t find any hints or demo programms for these questions
Regards,
Andyit is not possible to Edit the ALV using Object Model.
For coloring...check this code.
DATA: alv TYPE REF TO cl_salv_table.
TYPES: BEGIN OF ty_tab,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
color TYPE lvc_t_scol,
END OF ty_tab.
DATA: wt_color TYPE lvc_t_scol,
wa_color TYPE lvc_s_scol,
w_color TYPE lvc_s_colo.
DATA: wa_flight TYPE ty_tab.
DATA: column_tab TYPE REF TO cl_salv_columns_table,
column TYPE REF TO cl_salv_column_table.
DATA: column_ref TYPE salv_t_column_ref,
wa LIKE LINE OF column_ref.
DATA: it_flight TYPE STANDARD TABLE OF ty_tab.
SELECT carrid connid FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 10 ROWS.
w_color-col = 4.
w_color-int = 0.
w_color-inv = 0.
LOOP AT it_flight INTO wa_flight.
w_color-col = 4.
wa_color-fname = 'CARRID'.
wa_color-color = w_color.
APPEND wa_color TO wt_color.
w_color-col = 6.
wa_color-fname = 'CONNID'.
wa_color-color = w_color.
APPEND wa_color TO wt_color.
wa_flight-color = wt_color.
MODIFY it_flight FROM wa_flight.
ENDLOOP.
cl_salv_table=>factory(
IMPORTING
r_salv_table = alv
CHANGING
t_table = it_flight
"get all the columns
column_tab = alv->get_columns( ).
column_tab->set_color_column( value = 'COLOR' ).
column_ref = column_tab->get( ).
"loop each column
LOOP AT column_ref INTO wa.
"Conditionally set the column type as key or non key
IF wa-columnname = 'CARRID'.
column ?= wa-r_column.
column->set_key( abap_true ).
ENDIF.
ENDLOOP.
alv->display( ). -
ALV Object Model - Merged Cells
Hi all
When utilizing ALV Object Model, how do I display cells as merged when they have the same content?
Can someone help me out?
Thank you very much!Hello Yun
In dialog cells are merged automatically as soon as you sort the column containing repeated values.
Thus, when you call method SET_TABLE_FOR_FIRST_DISPLAY you should additionally provide parameter IT_SORT with the appropriate entries.
For example, you want to sort your ALV list according to COL_A (1st) and COL_B (2nd):
ls_sort-spos = 1.
ls_sort-fieldname = 'COL_A'.
ls_sort-up = 'X'. " sort ascending
append ls_sort to lt_sort.
ls_sort-spos = 2.
ls_sort-fieldname = 'COL_B'.
ls_sort-up = 'X'. " sort ascending
append ls_sort to lt_sort.
Regards
Uwe -
Dear All
Can anybody tell me, where will i find the examples for ALV report using object model (two-dimensional table).
Thanks
raviHi Ravindra,
Transaction DWDM, Under grid controls...
Also check out all report programs that contain BCALV_GRID*
BCALV_GRID_DEMO being the simple one..
CL_GUI_ALV_GRID is the class, you can find some sample programs by doing a where used list on it as well..
Sri
Message was edited by: Srikanth Pinnamaneni -
Alv object model and cl_salv_hierseq_level
I have used the cl_salv_hierseq_level to enable expand and collapse on an instance of cl_salv_hierseq_table.
The function to show the detail lines works until the grid table is refreshed from the database. I have tried using the set_items_expanded method again after the refresh to no avail.
Can anyone provide information on how to use the class and methods after some grid processing to keep expand and collapse enabled?There are no replies to this question; but I have noticed the expand/collapse works after process and refresh now.
-
Message in Status Bar while using ALV Objects
Hi All,
If we use ALV in objects (Build in class and methods for ALV),is it possible to display a error message using Message statement in Status bar.
Thanks in advance.Hi,
Yes, it is possible. You can do it using the ALV Object Model (ALV OO methods) within an event handler method. For example, the event "added_function of cl_salv_events" can be used and you can add code similar to the following code within the event handler method:
CASE e_salv_function.
WHEN 'XYZ'.
MESSAGE w001(00) WITH 'Message text goes here...'.
ENDCASE.
The warning message will either show up as a popup or in the status bar depending on your user settings. Of course, you can also use other message types (e.g. I, E, S) or other message techniques besides the message statement.
Best Regards,
Jamie -
Logo in Object Model ALV ?
Hi Experts
I have a small doubt in object model alv...
Is there any chance to create logo in alv using OBJECT MODEL (CL_SALV_TABLE)..
Regards,
VamsiHey, check this example code:
METHOD alv_set_header.
DATA: lv_grid TYPE REF TO cl_salv_form_layout_grid, "Header Layout
lv_label TYPE REF TO cl_salv_form_label, "Label
lv_logo TYPE REF TO cl_salv_form_layout_logo, "Logo
lv_text TYPE REF TO cl_salv_form_text. "Text
CREATE OBJECT lv_grid.
lv_label = lv_grid->create_label(
text = 'Execution Date:'(008)
row = 1
column = 1 ).
lv_text = lv_grid->create_text(
text = sy-datum
row = 1
column = 2 ).
lv_label = lv_grid->create_label(
text = 'Execution Time:'(009)
row = 2
column = 1 ).
lv_text = lv_grid->create_text(
text = sy-uzeit
row = 2
column = 2 ).
lv_label = lv_grid->create_label(
text = 'Responsible:'(010)
row = 3
column = 1 ).
lv_text = lv_grid->create_text(
text = sy-uname
row = 3
column = 2 ).
lv_grid->add_row( ).
lv_grid->add_row( ).
lv_grid->add_row( ).
lv_label = lv_grid->create_label(
text = 'Total Records:'(011)
row = 5
column = 1 ).
lv_text = lv_grid->create_text(
text = me->mv_total
row = 5
column = 2 ).
lv_label->set_label_for( lv_text ).
CREATE OBJECT lv_logo.
lv_logo->set_left_content( lv_grid ).
lv_logo->set_right_logo( 'CUSTOMER_LOGO' ) .
me->mo_salv_table->set_top_of_list( lv_logo ).
ENDMETHOD. "alv_set_header -
End_of_page in alv
Hi ,
Can anyone send me some sample code for the end_of_page in ALV using (reuse_alv_grid_display) . Iam not using the Object Oriented ALV .
I generated a report using alv , with end-of-page , where the text is getting displayed only in the print priview of the alv .
Can anyone explain this .
Vighnesh .hey u the prerequisite for using end_of_page in alv is ........
u should use reserve_lines in u r report ..................
after reserving the the lines only u r end of page will trigger ..................
DATA: gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
perform build_events.
perform build_print_params.
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
reward points if helpful.......
Message was edited by:
raam -
Object Model - cl_salv_hierseq_table Check box hide and Display
I am making use of Object model for creating the hierseq ALV.
I have added a checkbox to my ALV by making use of
gr_selections = gr_table->get_selections( level = 1 ).
gr_selections->set_selection_mode(cl_salv_selections=>if_salv_c_selection_mode~multiple ).
As u can make out by the Value Level = 1 the checkbox is at the header level.
1.) My query is that i want to Enable the checkbox for some header level records and and Disable some header level records based on a condition.
2.) Second query is that I want to read records from the alv in which the checkbox is checked..
Kindly answer.
Thanks,
Nikhil JunejaHi aRs. You need to use the class CL_SALV_SELECTIONS for this. See here,
DATA: gt_parent TYPE TABLE OF scarr.
DATA: gt_child TYPE TABLE OF sflight.
DATA: gr_table TYPE REF TO cl_salv_hierseq_table.
DATA: gr_selections TYPE REF TO cl_salv_selections.
DATA: lt_binding TYPE salv_t_hierseq_binding.
DATA: ls_binding TYPE salv_s_hierseq_binding.
SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE gt_parent.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_child.
ls_binding-master = 'CARRID'.
ls_binding-slave = 'CARRID'.
APPEND ls_binding TO lt_binding.
CALL METHOD cl_salv_hierseq_table=>factory
EXPORTING
t_binding_level1_level2 = lt_binding
IMPORTING
r_hierseq = gr_table
CHANGING
t_table_level1 = gt_parent
t_table_level2 = gt_child.
gr_selections = gr_table->get_selections( level = 1 ).
gr_selections->set_selection_mode( cl_salv_selections=>if_salv_c_selection_mode~multiple ).
gr_table->display( ).
This will give you the checkboxes in the parent level, you still need to write the code to get the selected rows.
Regards.
Rich Heilman -
SALV Object Model - Info needed
Hi All,
I want to create a screen as per below mentioned using
SALV Object Model
I am looking some tutorial how to do this use SALV.
Your help will be appreciated
Node |No:______ Date: ________
a |Desc: ________________________ Deleted : _
b | (Here above field are editable)
c |-------------------------------------------
d |
e |
f |
g |
| Here i want an ALV Editable Grid
| on the basis of tree node selection
| on the left hand side
|
|
|
a®Rich,
Thanks for your reply.
Whether can i use CL_GUI_ALV_GRID along with SALV?
I searched for some simple tutorial for
SALV tree model, could not find,
a® -
Create a site collection with dedicated content db with the help of server object model
Hi,
I have a requirement to implement a create a new site collection with dedicated content db. i have got 2 PowerShell scripts which does the same. first i will create a content db and then create the sitecollection with contentdb
parameter with the created contentdb name.
Now the site collection created must contain few doc libs and few splists with look up columns, people picker data type, multiline of text, single line of text,choice field. hence i am thinking the below approach:
1) create a web template and include sp doclibs, splists , site columns in this.
2) i am thinking of a ui design to create the below:
These are called "projects" which is actually the site collection with the doclibs, splists and must be created by sharepoint admin on click of a link in my landing page.end users access these "projects" aka
"site collections" and uploads the documents into these projects and collaborate.
so my question is : On click of a button can I create a site collection with a dedicated content db based on the web template created with the hel of server object model?
The other approach is on click of this button call the power shell script which accepts the sitecollection name and contentdb name as parameter. is this possible in server obj.model ?
passing a paramter from code behind- visual web part ui to power shell ?
and it should create the site collec based on the web template and create the content db.
my doubt #3 : will it not throw error "request timed out" when creating the site collec and contentdb from ui ?Try below:
http://sharepoint.stackexchange.com/questions/21606/programmatically-create-a-site-collection-in-an-existing-mounted-content-databa
PowerShell is just a wrapper for the object model. You shouldn't need to reference PowerShell in your feature, just create the new site collection with C# inside your feature. There's a blog post here that illustrates some code that may get you started.
http://blog.mastykarz.nl/programmatically-creating-sites-site-collections-custom-web-template/
http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx
# Enable the remote site collection creation for on-prem in web application level
# If this is not done, unknon object exception is raised by the CSOM code
$WebApplicationUrl = http://dev.contoso.com
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
Write-Host "Loading SharePoint Powershell Snapin"
Add-PSSnapin "Microsoft.SharePoint.Powershell"
$webapp=Get-SPWebApplication $WebApplicationUrl
$newProxyLibrary = New-Object "Microsoft.SharePoint.Administration.SPClientCallableProxyLibrary"
$newProxyLibrary.AssemblyName = "Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
$newProxyLibrary.SupportAppAuthentication = $true
$webapp.ClientCallableSettings.ProxyLibraries.Add($newProxyLibrary)
$webapp.Update()
Write-Host "Successfully added TenantAdmin ServerStub to ClientCallableProxyLibrary."
# Reset the memory of the web application
Write-Host "IISReset..."
Restart-Service W3SVC,WAS -force
Write-Host "IISReset complete."
If this helped you resolve your issue, please mark it Answered -
Conflict between Client object model and Item Updated Event Receiver in sharepoint 2010
Hello All,
As per my requirement I have a two custom list.
Agent Details
Port Name
Agent Details contains Agent code, Port Name, email, address and phone of Agent. Its possible that one Agent Code is connected with multiple Port Name.
Basically what I am doing is I am getting port name connected with Agent code, using jquery and bind those values with check box(using javascript created dynamically) and bind all with Div tag.
Now when my custom edit form of Agent list open up it shows me different port name binding with checkbox group.
when user select the check box and click confirm button my clicent object model script will run and add this selected value into Port Name list.
After confirm one more button named Save will enable asking user to edit the email, phone or address value and when I click on save my Item updated event fires which update the values of the selected port name(These port name I am getting from port
name list) to Agent Details custom list.
Now when I am trying to update the values my event receiver fires or some times it got stuck(not firing). So could you please help me the possible alternative for this requirements.
Can we user the Ecma Script(Client object model to preserve the value of selectec port) and Item updated event receiver on the same time?
Is anything am doing wrong then please guide me.Hi,
As I understand, when you updated values in the agent details list the Item updated event receiver got stuck sometimes.
The item update event receiver will fire after the item has been saved, and the client object model script or the Ecma Script runs before the item is saved, so there is no conflict between the client object model script and item update event receiver.
You could find out the reason about the item update event receiver gets stuck by debugging the event receiver.
When you want to debug your event receivers, you have to attach to OWSTIMER.EXE and wait till they are executed. You can control this behavior using the Synchronization attribute. Also, if you’re looking for an easy way to debug an event receiver without
having to manually attach a debugger to your code, you can use the System.Diagnostics.Debugger.Launch() method.
The articles below are about how to debug in the event receiver in SharePoint 2010.
http://sharepoint-kings.blogspot.jp/2013/02/debugging-event-receivers-in-sharepoint.html
http://chakkaradeep.com/index.php/event-receivers-in-sharepoint-2010/
http://sharesaint.com/?p=77
Best regards,
Sara Fan
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]
Maybe you are looking for
-
Ok wy iTunes got deletes off my computer and I had an iPod 3 now I have an iPhone 4 And I Reyes to buy some music using the same iTunes account but it says purchased and I'm just wonderin if there is anyway I can get the music I had on my iPod to my
-
I've just ordered a new MacBook Pro, but I don't know how to transfer video from my Panasonic P2 cards to the new laptop that uses express cards. Does anyone know of a reasonably priced reader, or some other solution? Thanks
-
Oracle 10g on Windows Server 2003 One Listener Service with Two instances I understand you, the reader, may have some experience working with Oracle Servers and I am hoping you may be able to shed some light on my current issue. I have Oracle 10g Ver
-
Hi. Transferring songs from i-Pod to Mac
My old Windows PC recently crashed, taking with it the 3500 songs I had in i-tunes. Fortunately, I still have them on my i-pod Classic. However, am I right in thinking that there is no way of transferring them from my i-pod to my Mac without purchasi
-
Adobe Indesign CS6 Pricing - Multiple Users
Hi all, I would like to know in detail about the price plans for Indesign version CS6 with multiple user license (maximum 4). Please note that, We dont need the creative suite or the CC. Reply will be highly appreciated.