Enable or disable particular record in list item based on a corresponding c
Hi,
How can i Enable or disable property of particular record in list item (multi record) based on a corresponding check box(multi record) ,
e.g Form Structure:
if press a button then record should populate where multi_post_query
if my_check_box = 1 then
my_list_item disable to update;
else
my_list_item enable to update;
end if;
now wanted result is like below
my_check_box ---- my_list_item
+----------------------enable
+----------------------enable
+----------------------enable
_----------------------Disable
_----------------------Disable
Here "+" means checked,"_" means unchecked and "enable" means updatable "Disable" means not updatable
the pseudo code is like,
if my_check_box = 1 then
my_list_item enable to update;
else
my_list_item disable to update;
end if;
Note: my_check_box is not updatable
please tell me which trigger and where I should create
Thanks
Edited by: 838602 on Feb 21, 2011 11:12 PM
Edited by: 838602 on Feb 22, 2011 1:40 AM
Hi Abdetu,
I created WHEN-NEW-RECORD-INSTANCE Trigger at data block level
And I need should work like below pseudo code (sorry for previous pseudo code)
if my_check_box = 1 then
my_list_item disable to update;
else
my_list_item enable to update;
end if;
so change code as
IF :MULTI.PROTECTED_FIELD = 1 THEN
SET_ITEM_PROPERTY ('MULTI.ACTION',REQUIRED , PROPERTY_FALSE );
SET_ITEM_PROPERTY('MULTI.ACTION',NAVIGABLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY ('MULTI.ACTION' ,UPDATE_ALLOWED,PROPERTY_FALSE);
SET_ITEM_PROPERTY ('MULTI.ACTION' ,INSERT_ALLOWED,PROPERTY_FALSE);
:multi.action := 0;
ELSE
SET_ITEM_PROPERTY ('MULTI.ACTION',REQUIRED , PROPERTY_TRUE);
SET_ITEM_PROPERTY('MULTI.ACTION',NAVIGABLE,PROPERTY_TRUE);
SET_ITEM_PROPERTY ('MULTI.ACTION' ,UPDATE_ALLOWED,PROPERTY_TRUE);
SET_ITEM_PROPERTY ('MULTI.ACTION' ,INSERT_ALLOWED,PROPERTY_TRUE);
END IF;
Sorry, still I am not getting desired o/p. even i check item (ACTION) level Trigger
Note: my_check_box is not updatable
that would assign at time of button press (post query) as i mentioned
Edited by: 838602 on Feb 22, 2011 1:41 AM
Similar Messages
-
Populate the values to list item based on a check box
Hi,
How can i populate the values from a field on the form to one list item based on a check box,
the pseudo code is like,
if checkbox = checked then
populate the particular field value to the list item;
checkbox = unchecked;
next_record;
end if;
Thanks
BcjTo populate a Tlist item, do the following:
1. Create a TLIST item in the EMP block. and give it a height to accommodate several names.
2. Using the TLIST property pallete:
a. Set the Column Name property to EMPNO
b. Click on the Elements in List property. Delete each List Element and delete each List Item Value. If you don't do this you will get an error when you compile.
3. Create a record group using this query:
select ename, to_char(empno) from emp
4. Create a WHEN-NEW-FORM-INSTANCE trigger, and place this code inside the trigger:
Declare
err_num number;
Begin
clear_list('YOUR_TLIST');
err_num := populate_group('YOUR_RECORD_GROUP');
If err_num = 0 Then
populate_list('YOUR_TLIST', 'YOUR_RECORD_GROUP');
Else
message('Error populating Tlist');
message('Error populating Tlist');
End If;
End;
5. Compile and run the form. The ENAMEs will appear in the TList, and each ENAME will have a value equal to its EMPNO. -
CAML Query to Sort SharePoint list items based on Modified date
hi ,
can we sort sharePoint list items based on 'Modified' column, the sorting should be done up to milliseconds level.
currently i am using CAML query as below
<OrderBy><FieldRef Name='Modified' Type='DateTime' IncludeTimeValue='TRUE' Ascending='False'/></OrderBy>but its not considering milliseconds while sorting.
Thanks and Regards,
venkatesh.Veda, thanks but I'm not really a hardcore C# coder.
We found more elegant solution was to create a List View which returns all records that should be deleted, based on our own custom deletion criteria, and then create an very simple SSIS Package in Visual Studio using the
Sharepoint Connectors for SSIS to delete all Sharepoint List Items returned from that List View. The Sharepoint Destination Connector has a delete operation.
This worked for us and didn't require any coding. -
Workflow to grant access to each List item based on a column value
Hi,
I have 2 lists Risks and RisksLookup.
In Risks, I have Title, Description, service impacted and status columns.
In RisksLookup, I have service impacted, AD1, AD2, AD3, AD4 and AD5.
I have a requirement where in I have to write a Workflow to provide access to each List item based on the value of service impacted. i.e. If service impacted in Risks List is Client A, I have to lookup what all AD groups are present for Client A in RisksLookup
List and provide access to only those groups for that item.
Regards, Shreyas R SHi
another approach
create 5 more lists, dedicated to each impacted service. for Each one these lists apply needeed right ( based onAD groups )Keep you main list where first level will add new items . Attach a workflow to this main list, which will start when an item
is added and which will add specific item's value to his new list ( based on impacted service value )
Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you. -
Display list items based on another list item
Hi All
I want to display the list item based on another list item, but its not working.
This is my code:
/*WHEN-NEW-FORM-INSTANCE*/---Its working.
DECLARE
rg_district recordgroup;
rg_name VARCHAR2 (40) := 'district';
vtemp NUMBER;
BEGIN
rg_district := FIND_GROUP (rg_name);
IF ID_NULL (rg_district)
THEN
rg_district :=
CREATE_GROUP_FROM_QUERY (rg_name,
'select dist,dist from district_mas'
vtemp := POPULATE_GROUP (rg_district);
POPULATE_LIST ('BLOCK3.DISTRICT', rg_name);
END IF;
END;
*/WHEN-LIST-CHANGED*/---Not working. Cannot populate the list based on the List
DECLARE
rg_branch recordgroup;
rg_name1 VARCHAR2 (1000) := 'branch';
vtemp NUMBER;
BEGIN
rg_branch := FIND_GROUP (rg_name1);
IF NOT ID_NULL (rg_branch)
THEN
DELETE_GROUP (rg_name1);
rg_branch :=
CREATE_GROUP_FROM_QUERY
('rg_branch',
'SELECT branch FROM dist_branch WHERE district IN (SELECT DIST FROM DISTRICT_MAS WHERE DISTRICT ='
|| :BLOCK3.DISTRICT
vtemp := POPULATE_GROUP (rg_branch);
POPULATE_LIST ('BLOCK3.BRANCH', rg_branch);
END IF;
END;
Table:
CREATE TABLE DISTRICT_MAS
DIST VARCHAR2(100 CHAR)
CREATE TABLE DIST_BRANCH
DISTRICT VARCHAR2(100 CHAR),
BRANCH VARCHAR2(100 CHAR)
Values:
insert into district_mas values('chennai');
insert into district_mas values('coimbatore');
insert into dist_branch values('chennai','chennai_north');
insert into dist_branch values('coimbatore','Podanur');
Regards
Shagar MHmm, not tested.
try this..
--*/WHEN-LIST-CHANGED*/
DECLARE
rg_branch recordgroup;
rg_name1 VARCHAR2 (1000) := 'branch';
vtemp NUMBER;
QT VARCHAR2(10) :='''';
BEGIN
rg_branch := FIND_GROUP (rg_name1);
IF NOT ID_NULL (rg_branch)
THEN
DELETE_GROUP (rg_name1);
rg_branch :=
CREATE_GROUP_FROM_QUERY
('rg_branch',
'SELECT branch FROM dist_branch WHERE district IN (SELECT DIST FROM DISTRICT_MAS WHERE DISTRICT ='
|| QT||:BLOCK3.DISTRICT||QT||')'
vtemp := POPULATE_GROUP (rg_branch);
POPULATE_LIST ('BLOCK3.BRANCH', rg_branch);
END IF;
END;
Hope this works..
Hamid -
Filter list items based on security groups o365
How to filter list items based on security groups in o365.
Hi,
According to your description, my understanding is that you want to filter list items based on the Office 365 security groups.
If that is the case, I suggest you can create a data view to filter the list items with CAML Query like below:
<Where>
<Membership Type="CurrentUserGroups">
<FieldRef Name="VisibleToGroup"/>
</Membership>
</Where>
For more information, please refer the detailed article below:
SharePoint - Filtering a View by Group Membership
Thanks
Best Regards
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] -
Want 2 populate value in 2nd list item based on value selected in 1st list?
Want 2 populate value in 2nd list item based on value selected in 1st list?
Gaurav -
The 3rd list will not populate because nothing has been selected yet in list 2. The value in list 2 is null, so the loop to populate list (3) has nothing to load. Try the following below. This should seed your 2nd list so the 3rd list will populate.
You will have to declare first_record boolean and first_value to match DESCC.
first_record := true; -- NEW *****
Clear_List('BLOCK2.ITEM2');
FOR CurRec IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.IDD = :BLOCK2.ITEM1)
LOOP
if first_record = true then -- NEW SECTION *****
first_value := CurRec.DESCC;
first_record := false;
end if;
Add_List_Element('BLOCK2.ITEM2',1,CurRec.DESCC,CurRec.DESCC);
END LOOP;
:block2.item2 := first_value; -- NEW *****
Clear_List('BLOCK2.ITEM3');
FOR CurRec2 IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.DESCC = :BLOCK2.ITEM2)
LOOP
Add_List_Element('BLOCK2.ITEM3',2,CurRec2.DESCC,CurRec2.DESCC);
END LOOP;
My name is Ken, 1990 is when I started using Oracle Forms 3.0, character based in the Unix environments. And you are very welcome. -
How to disable particular record?
Hi,
I am working with ALV List Display. After displaying the output, there is an Check Box option in the report output.
If I check for a particular record and delete that particular record, that record only should be disabled remaining records should be enabled, So that I can check another record and delete that record.
Please given solution for the above ASAP.
Thanks,
Vinay.Hi Vinay,
Try the following sample code :
REPORT y131_alv_test.
TYPE-POOLS : slis.
DATA : BEGIN OF str_test,
check,
name,
END OF str_test.
DATA : it_test LIKE TABLE OF str_test WITH HEADER LINE,
wa_fldcat TYPE slis_fieldcat_alv,
it_fldcat TYPE slis_t_fieldcat_alv.
it_test-name = 'NAME1'.
APPEND it_test.
it_test-name = 'NAME2'.
APPEND it_test.
wa_fldcat-fieldname = 'CHECK'.
wa_fldcat-seltext_l = 'CHECKBOX'.
wa_fldcat-checkbox = 'check'.
wa_fldcat-input = 'X'.
APPEND wa_fldcat TO it_fldcat.
CLEAR wa_fldcat.
wa_fldcat-fieldname = 'NAME'.
wa_fldcat-seltext_l = 'DISPLAY NAME'.
APPEND wa_fldcat TO it_fldcat.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'Y131_ALV_TEST'
i_callback_user_command = 'RETURN'
it_fieldcat = it_fldcat
TABLES
t_outtab = it_test.
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
*& Form RETURN
* text
***The subroutine should be of the following interface
FORM return USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'CHECK'.
IF rs_selfield-value = 'X'.
DELETE it_test WHERE check = 'X'.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "RETURN
This would help you, reward if convinced with the code.
Regards -
Order Records by List Item description
Can someone please give me some tips on how to solve the following issue?
I have a List Item that is populated using the following record group query:
SELECT DOC_TYPE_DESC, TO_CHAR(DOC_TYPE_INFO_ID) FROM DOC_TYPE_INFO WHERE ACTIVE = 'Y' ORDER BY DOC_TYPE_DESC
The DOC_TYPE_INFO_ID is stored with the actual record (foreign key relationship) but the user will see the description values in order to make a selection.
I'd like to give the user the option of ordering the records by this description value.the function has to be on the database to be used in sql.
the sql sent by forms to the database when it queries the block has to be something like this
select ...
from documents
where...
order by my_database_function(doc_type_info_id)
the function returns the doc_type_desc from the doc_type_info table for the specified doc_type_info_id.
put "my_database_function(doc_type_info_id)" in the block's order by property.
there might be a more efficient method. try this out:
select * from documents
order by (select doc_type_desc from doc_type_info where doc_type_info_id = documents.doc_type_info_id)
if that works, put the bold bit in the order by property instead of using the function. -
Re: Empty record in list item
I would be very greatful it anybody could help me.
I have created a recordgroup for list item and populated the same. All values are dispalyed properly but in addion one empty record is appear. how can i remove the empty record ? my syntax are as under:
declare
v_rg NUMBER;
v_GrpID RECORDGROUP;
begin
v_GrpID := CREATE_GROUP_FROM_QUERY('DRVCODE', 'SELECT led_name ,led_name FROM master_ledger where cmp_code=:global.cmp_code ORDER BY 1');
v_rg := POPULATE_GROUP(v_GrpID);
IF v_rg = 0 THEN
POPULATE_LIST('master_driver.tdrvname', v_GrpID);
END IF;Just add the last line after your code... that is you set the value after populating the list-item;
declare
v_rg NUMBER;
v_GrpID RECORDGROUP;
begin
v_GrpID := CREATE_GROUP_FROM_QUERY('DRVCODE', 'SELECT led_name ,led_name FROM master_ledger where cmp_code=:global.cmp_code ORDER BY 1');
v_rg := POPULATE_GROUP(v_GrpID);
IF v_rg = 0 THEN
POPULATE_LIST('master_driver.tdrvname', v_GrpID);
END IF;
:master_driver.tdrvname:= v_value;where v_default_value is a variable containing the default value for your list_item (or the specific value that you want it to be pre-set, that could be a table stored value). -
Listing Items based on criteria e.g. High Priority Items First.
Hi,
One of our customers have a need to List High Priority Items first on the WebTools site.
Let's take two ItemCodes for example: Printer001, and, Monitor001.
>> If these two items are included in the same category then Monitor001 will appear before Printer001 as WebTools sorts in alphabetic ascending order;
>> But, our customer wants Printer001 to appear before Monitor001 as it is an Item higher in priority that Printer001.
I can think of two possible solutions:
1/2) Prefix Items with a number or letter to have it appear first in the WebTools default sort order. E.g. Rename "Monitor001" as "AMonitor001". This will not be possible for existing Items in SAP, so it doen't solve the issue,
Or,
2/2) Customize the Default WebTools Item List block to sort Items based on a User Define field called "pririty". Which might require a lot of effort.
Please advise if anyone else has solved similar issue and how.
Thanks very much for your replies in advance.Hey Kafil ... I think you may be stuck modifying the parts list page or creating something from scratch. I'm not aware of an easy way to do this out of the box.
-
Update a list item based sort order of created by column value
HI
using powershell script how to sort a list column before update a list item.
here i created a document library and uploaded some documents and update ProcessNo column based sort order of created column
value.
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$webURL = "http://tspmcwfe:91" $listName = "Courts"
Get the SPWeb object and save it to a variable
$web = Get-SPWeb $webURL
$list = $web.Lists[$listName]
$items = $list.items
Go through all items
foreach($item in $items)
$item["ProcessNo"] = 1
$item.Update()
$web.Dispose()Hi,
According to your description, my understanding is that you want to sort the list items order before updating items using PowerShell.
I suggest you can use the Sort-Object command to sort the list items.
Here are some detailed articles for your reference:
Better SharePoint Lists and List Items in PowerShell
Sort-Object
Thanks
Best Regards
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] -
Retrieve List Items based on condition in Where Clause
Hello Experts,
I am trying to retrieve list items from a list (CityList) which contains 2 columns one is city(string) and State(Lookup) based on Lookup value, but i am getting all city names.
here is my query below.
function MainFunction() {
var lookupid = 5;
var myQueryString = "<Where><Eq><FieldRef Name='State' LookupId='true' /><Value Type='Lookup'>"+lookupid+"</Value></Eq></Where>";
var myContext = new SP.ClientContext.get_current(); ;
var myWeb = myContext.get_web();
var myList = myWeb.get_lists().getByTitle("CityList");
var myQuery = new SP.CamlQuery();
myQuery.set_viewXml(myQueryString);
myItems = myList.getItems(myQuery);
myContext.load(myItems, 'Include(Title)');
myContext.executeQueryAsync(Function.createDelegate(this, GetListDataSuccess), Function.createDelegate(
this, GetListDataFail));
function GetListDataFail(sender, args) {
// Show error message
alert('GetListDataFail() failed:' + args.get_message());
function GetListDataSuccess(sender, args) {
var currListItemCount = myItems.get_count();
var currItemEnumerator = myItems.getEnumerator();
var currItemDetails = '';
while (currItemEnumerator.moveNext()) {
var currItem = currItemEnumerator.get_current();
currItemDetails = currItemDetails + ';' + currItem.get_item("Title");
// Show details
alert(currItemDetails);
Please suggest where i am wrong.
Thank you
sarojYou need to enclose the <Where> tag inside <View><Query> . Try like below
var myQueryString = "<View><Query><Where><Eq><FieldRef Name='State' LookupId='TRUE' />
<Value Type='Lookup'>"+lookupid+"</Value></Eq></Where></Query></View>";
Geetanjali Arora | My blogs | -
Dynamically changing the list item based on another list item
Hi all,
I have two fields that are list items.
First list item contain two list values: Regular and One-time
In second list item if user select the Regular then below values should appear:
Daily wages
Activity Linked
Fixed Contracts.
Contract Staff
Outsourced
if user select the one-time then below values should appear:
Projects
Repairs & Maint.
Please do the needful.First list item contain two list values: Regular and One-timeYou simply need to add a conditional check to the When-List-Changed (WLC) trigger to see which value was selected. Then, as Manu suggests, you will populate the Poplist based on the selected value.
For an example of how to dynamically populate a Poplist item, take a look at: Forms: How to Dynamically Populate a Poplist.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Qualified list item based on two columns
- fact table inludes following columns
key1
key2
measure1
In segment designer, update counts:
the query must counts two columns "key1 and key2" that key1 and key2 together must be distinct.Here you go:
SQL> WITH bill AS
2 (
3 SELECT 1000 AS billno, 101 AS advertiserid, 102 AS agencyid, 5000 AS total_value FROM DUAL UNION ALL
4 SELECT 1001, 101, 103, 5000 FROM DUAL UNION ALL
5 SELECT 1002, 101, 102, 1000 FROM DUAL
6 ), account AS
7 (
8 SELECT 101 AS account1_id, 102 AS account2_id, 'John' AS name, 50 AS empid FROM DUAL UNION ALL
9 SELECT 101, 103, 'James', 40 FROM DUAL UNION ALL
10 SELECT 101, 105, 'Joe', 60 FROM DUAL
11 )
12 /* End Sample Data */
13 SELECT a.name
14 , a.empid
15 , a.account1_id
16 , a.account2_id
17 , SUM(b.total_value)
18 FROM account a
19 JOIN bill b ON a.account1_id = b.advertiserid
20 AND a.account2_id = b.agencyid
21 GROUP BY a.name
22 , a.empid
23 , a.account1_id
24 , a.account2_id
25 ;
NAME EMPID ACCOUNT1_ID ACCOUNT2_ID SUM(B.TOTAL_VALUE)
John 50 101 102 6000
James 40 101 103 5000
Maybe you are looking for
-
High Pitched Sound from X61 -- sent in for repair
So, since the very beginning of my Lenovo Thinkpad ownership I have experienced a high pitched noise when on High Performance battery power. So I just switched it to Power Saver mode and forgot about it (Busy student, hard to find time to go weeks wi
-
How do you set the time and date for the fax on the HP Office Jet 4622 All-in-one Printer?
I installed the HP Office Jet 4622 All-in-one Printer and everything works wonderfu. However on the test page for the fax the time and date are showing Jan-00-00 00:00AM. I do not know how to change the date and time. Please help. Thanks. This qu
-
What about this battery life???!!!
Has anyone come up with an optional battery. Even with the Advanced Killer, my battery doesn't last an entire day. And I don't talk on the phone much at all for it to go dead like it does..Help!
-
Authority check for sales order and stock transport order
In my code i have a requirement to enter sales order and Stock transport order. However i want that a WM resource should not be allowed to enter sales order and an SD resouce should not be allowed to enter stock tranpsort order. Please suggest.
-
Program UJA_DATA_CHECKER
Hi, After installing BPC NW 10 ON BW 740 SP02 (ON HANA) I can't find the Infoobject catalog of the ENVIRONEMENTSHELL AND when I execute the program UJS_ACTIVATE_CONTENT It shows no errors, But when I run the programm UJA_DATA_CHECKER it generate